https://github.com/nightlyone/atomic
Atomic operations as methods on types
https://github.com/nightlyone/atomic
atomicity go golang
Last synced: 5 months ago
JSON representation
Atomic operations as methods on types
- Host: GitHub
- URL: https://github.com/nightlyone/atomic
- Owner: nightlyone
- License: bsd-3-clause
- Created: 2017-03-21T23:09:12.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-03-06T02:27:14.000Z (over 5 years ago)
- Last Synced: 2024-06-19T23:15:27.496Z (about 2 years ago)
- Topics: atomicity, go, golang
- Language: Go
- Size: 7.81 KB
- Stars: 4
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# atomic
Atomic operations as methods on types
[](https://pkg.go.dev/github.com/nightlyone/atomic)
[](https://travis-ci.org/nightlyone/atomic)
# example usage
```go
package main
import (
"fmt"
"github.com/nightlyone/atomic"
)
type Service struct {
Health atomic.Bool
}
func main() {
service := new(Service)
isHealthy := service.Health.Value()
fmt.Printf("service is healthy? %t\n", isHealthy)
// Output: service is healthy? false
}
```
# LICENSE
BSD-3-Clause
# Contributing
Pull requests and github issues welcome.