[!WARNING]
env is in heavy development. its design, behavior, and public interfaces are
subject to change at any time without notice. do not rely on it for production use.
env
typesafe env utilities for go.
usage
package main
import (
"fmt"
"codeberg.org/ungo/env"
)
type Config struct {
Environment string `env:"ENVIRONMENT,default=dev"`
}
var cfg Config
func init() {
err := env.Load(&cfg)
if err != nil {
panic(err)
}
}
func main() {
fmt.Println("current environment:", cfg.Environment)
}
maintainers
license
this software is published under CC0 1.0 Universal (public domain) along with an ip waiver. see
license file.
aka: do whatever you want.