7
3
Fork
You've already forked env
0
typesafe env variables
  • Go 91%
  • Nix 9%
2026年05月31日 06:03:02 +02:00
dotenv feat: dotenv 2026年01月04日 00:04:59 +01:00
examples feat: custom validations 2026年04月29日 20:15:20 +02:00
.env.example feat: nested structs handling ( #1 ) 2026年03月28日 15:29:46 +01:00
.envrc feat: skeleton 2025年12月26日 22:26:46 +01:00
.gitignore feat: skeleton 2025年12月26日 22:26:46 +01:00
env.go fuck 2026年05月31日 06:03:02 +02:00
flake.lock feat: skeleton 2025年12月26日 22:26:46 +01:00
flake.nix feat: skeleton 2025年12月26日 22:26:46 +01:00
go.mod feat: skeleton 2025年12月26日 22:26:46 +01:00
LICENSE Initial commit 2025年12月26日 19:49:06 +01:00
README.md feat: nested structs handling ( #1 ) 2026年03月28日 15:29:46 +01:00
validator.go feat: custom validations 2026年04月29日 20:15:20 +02:00

env

typesafe env utilities for go.

why env exists

most go config libraries try to solve everything: files, env, flags, hot reloads, plugins, abstractions on abstractions.

env doesn't.

usage

packagemainimport("fmt""codeberg.org/ungo/env""codeberg.org/ungo/env/dotenv")typeConfigstruct{Ageint`env:"AGE,default=30"`ApiUserstring`env:"API_USER,default=yehorovye"`}varcfgConfigfuncinit(){// load .env.example file manuallydotenv.MustLoad(".env.example")// parse structerr:=env.Load(&cfg)iferr!=nil{panic(err)}}funcmain(){fmt.Println(cfg.ApiUser,"your age is...",cfg.Age)// elisiei your age is 30}

source

nested structs usage

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.