Registry / config / caarlos0-env-v10

caarlos0-env-v10

JSON →
library10.0.0gogounverified

A simple and zero-dependencies library for parsing environment variables into structs.

go get github.com/caarlos0/env/v10
INSTALL
IMPORT
SIG · CAARLOS0-ENV-V10
C
caarlos0-env-v10
configgov10.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

env
github.com/caarlos0/env/v10

Parse environment variables into a struct

package main import ( "fmt" "github.com/caarlos0/env/v10" ) type Config struct { Port int `env:"PORT" envDefault:"3000"` Host string `env:"HOST" envDefault:"localhost"` } func main() { var cfg Config if err := env.Parse(&cfg); err != nil { panic(err) } fmt.Printf("%+v\n", cfg) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
10.0.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
14
OpenAI (training)
1
Resources
caarlos0-env-v10 — go get caarlos0-env-v10 · libregistry