https://github.com/rocketbitz/env
an easier to use environment variable package
https://github.com/rocketbitz/env
Last synced: 5 months ago
JSON representation
an easier to use environment variable package
- Host: GitHub
- URL: https://github.com/rocketbitz/env
- Owner: rocketbitz
- License: mit
- Created: 2019-11-17T19:04:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-17T20:15:40.000Z (over 6 years ago)
- Last Synced: 2025-08-14T17:03:00.421Z (11 months ago)
- Language: Go
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# env [](https://circleci.com/gh/rocketbitz/env/tree/master)
an easier to use environment variable package for gophers
# installation
as with all other go packages, you know what to do:
```
go get github.com/rocketbitz/env
```
# usage
go should probably have its own, but it doesn't, so here you are:
```go
package main
import (
"fmt"
"github.com/rocketbitz/env"
)
func main() {
env.SetDefault("DEFAULT_ENV", "default_value")
env.Get("DEFAULT_ENV") // "default_value"
env.Set("DEFAULT_ENV", "explicit_value")
env.Get("DEFAULT_ENV") // "explicit_value"
env.Count() // 1
env.JSON()
/*
[
{
"key": "DEFAULT_ENV",
"value": "explicit_value",
}
]
*/
}
```
# contribute
pr's are welcome. if they're awesome, they'll get reviewed and merged. if they're not, they'll get reviewed and closed, hopefully with a kind comment as to the reason.
# license
[MIT](https://github.com/rocketbitz/env/blob/master/LICENSE) ...move along, move along.