https://github.com/utahta/go-atomicbool
Atomic boolean for Go
https://github.com/utahta/go-atomicbool
atomicbool go
Last synced: 10 months ago
JSON representation
Atomic boolean for Go
- Host: GitHub
- URL: https://github.com/utahta/go-atomicbool
- Owner: utahta
- License: mit
- Created: 2016-10-29T02:54:55.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-29T02:57:45.000Z (over 9 years ago)
- Last Synced: 2025-03-04T17:37:13.244Z (about 1 year ago)
- Topics: atomicbool, go
- Language: Go
- Homepage:
- Size: 1.95 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Atomic Bool
[](https://travis-ci.org/utahta/go-atomicbool)
## Installing
```
$ go get -u github.com/utahta/go-atomicbool
```
## Usage
```go
package main
import (
"fmt"
"github.com/utahta/go-atomicbool"
)
func main() {
b := atomicbool.New(false)
if b.Disabled() {
fmt.Println("disabled")
}
b.Set(true)
if b.Enabled() {
fmt.Println("enabled")
}
}
```
## Contributing
1. Fork it ( https://github.com/utahta/go-atomicbool/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request