Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hscells/veil
A sensible and well tested flags and bitmask library for go.
https://github.com/hscells/veil
bitmask flags go golang
Last synced: 6 days ago
JSON representation
A sensible and well tested flags and bitmask library for go.
- Host: GitHub
- URL: https://github.com/hscells/veil
- Owner: hscells
- License: mit
- Created: 2017-11-01T05:52:22.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-01T07:37:49.000Z (about 7 years ago)
- Last Synced: 2024-11-07T13:57:45.356Z (about 2 months ago)
- Topics: bitmask, flags, go, golang
- Language: Go
- Homepage: https://godoc.org/github.com/hscells/veil
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Veil
[![GoDoc](https://godoc.org/github.com/hscells/veil?status.svg)](https://godoc.org/github.com/hscells/veil)
[![Go Report Card](https://goreportcard.com/badge/github.com/hscells/veil)](https://goreportcard.com/report/github.com/hscells/veil)
[![gocover](http://gocover.io/_badge/github.com/hscells/veil)](https://gocover.io/github.com/hscells/veil)_A sensible and well tested flags and bitmask library for the go language._
Veil can be used anywhere the need for a bit mask (e.g. `1010`) needs to be used
to represent some state.For instance, to find the values for a the mask above:
```go
fm := FlagsMapFromString([]string{"a", "b", "c", "d"}, "1010")
flag, err := fm.Get("a")
if err != nil {
fmt.Println(flag)
}
```A FlagsMap can also be constructed from a slice of `int8`, a slice of `bool`,
or a map. Please see the [documentation](https://godoc.org/github.com/hscells/veil)
for the full reference.