https://github.com/rafaeljesus/safe
Thread-safe for any value :lock:
https://github.com/rafaeljesus/safe
clean-code go threadsafe
Last synced: 10 months ago
JSON representation
Thread-safe for any value :lock:
- Host: GitHub
- URL: https://github.com/rafaeljesus/safe
- Owner: rafaeljesus
- License: mit
- Created: 2017-06-14T19:17:20.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-14T19:17:35.000Z (over 8 years ago)
- Last Synced: 2025-04-05T03:13:03.020Z (10 months ago)
- Topics: clean-code, go, threadsafe
- Language: Go
- Homepage:
- Size: 1.95 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Safe
* Thread-safe for any value.
## Installation
```bash
go get -u github.com/rafaeljesus/safe
```
## Usage
```go
package main
import "github.com/rafaeljesus/safe"
func main() {
data := map[string]interface{}{"key": "value"}
s := New(data)
result, ok := s.Get().(map[string]interface{})
if !ok {
// wrong type
}
// do something
}
```
## Contributing
- Fork it
- Create your feature branch (`git checkout -b my-new-feature`)
- Commit your changes (`git commit -am 'Add some feature'`)
- Push to the branch (`git push origin my-new-feature`)
- Create new Pull Request
## Badges
[](https://circleci.com/gh/rafaeljesus/safe)
[](https://goreportcard.com/report/github.com/rafaeljesus/safe)
[](https://godoc.org/github.com/rafaeljesus/safe)
---
> GitHub [@rafaeljesus](https://github.com/rafaeljesus) ·
> Medium [@_jesus_rafael](https://medium.com/@_jesus_rafael) ·
> Twitter [@_jesus_rafael](https://twitter.com/_jesus_rafael)