Releases: digvijay-tech/envconfig
Releases · digvijay-tech/envconfig
Release v1.0.0
Features
- Struct-based configuration: Load .env files into Go structs using
envconfigstruct tags - Type support: Supports
string,int/uintvariants,float32,float64, andbooltypes - Environment loading: Automatically loads parsed variables into
os.Getenv()for global access - Flexible file handling: Customisable
.envfile path and name (defaults to./.env) - Robust parsing: Handles comments, empty lines, quoted values, and validates environment variable keys
Usage
type Config struct {
Name string `envconfig:"NAME"`
Port int `envconfig:"PORT"`
}
opts := envconfig.EnvOptions[Config]{
Schema: &Config{},
}
config, err := envconfig.Configure(opts)Installation
go get github.com/digvijay-tech/envconfig@v1.0.0This is the initial release of envconfig, offering a simple and type-safe approach to effortlessly manage environment-based configuration in Go applications.