Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rosylilly/env
https://github.com/rosylilly/env
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/rosylilly/env
- Owner: rosylilly
- Created: 2023-07-29T05:03:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-29T05:03:28.000Z (over 1 year ago)
- Last Synced: 2024-12-22T13:14:51.578Z (15 days ago)
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# github.com/rosylilly/env
env provides utility methods for environment variables.
## Example
```go
package mainimport (
"log""github.com/rosylilly/env"
)type JSONValue struct {
A string `json:"a"`
B int `json:"b"`
}func main() {
strVal := env.String("FOO", "default value")
log.Println(strVal)intVal := env.Int("BAR", 100)
log.Println(intVal)jsonVal := env.JSON("BAZ", JSONValue{})
log.Println(jsonVal)
}
```