https://github.com/csothen/env
Small library to load and parse environment variables
https://github.com/csothen/env
environment-variables golang zero-configuration zero-dependencies
Last synced: 2 months ago
JSON representation
Small library to load and parse environment variables
- Host: GitHub
- URL: https://github.com/csothen/env
- Owner: csothen
- License: mit
- Created: 2021-09-18T22:07:23.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-09-29T20:28:55.000Z (over 3 years ago)
- Last Synced: 2025-02-02T00:38:54.773Z (4 months ago)
- Topics: environment-variables, golang, zero-configuration, zero-dependencies
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# env
Small library to parse environment variables
## Installation
`go get -u github.com/csothen/env`
## Usage
``` Go
import "github.com/csothen/env"func main() {
err := env.Load(".env")
if err != nil {
panic(err)
}name := env.String("NAME", "Csothen")
age := env.Int("AGE", 22)
height := env.Int32("HEIGHT", 171)
port := env.Int64("PORT", 8080)pi := env.Float32("PI", 3.14)
basePrice := env.Float64("BASE_PRICE", 100.00)show := env.Bool("SHOW_PRICES", false)
}
```