Registry / config / sethvargo-go-envconfig

sethvargo-go-envconfig

JSON →
library1.3.0gogounverified

Package envconfig populates struct fields based on environment variable values (or anything that responds to 'Lookup').

go get github.com/sethvargo/go-envconfig
INSTALL
IMPORT
SIG · SETHVARGO-GO-ENVCO
S
sethvargo-go-envconfig
configgov1.3.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.

envconfig
github.com/sethvargo/go-envconfig

Populate a struct from environment variables with defaults.

package main import ( "context" "fmt" "github.com/sethvargo/go-envconfig" ) type Config struct { Port int `env:"PORT, default=8080"` } func main() { var c Config ctx := context.Background() if err := envconfig.Process(ctx, &c); err != nil { panic(err) } fmt.Printf("Port: %d\n", c.Port) }
Debug
Known issues

No known issues recorded.

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

No dependency data recorded yet.

Agent activity
38 hits · last 30 days
node
26
OpenAI (training)
1
Resources
sethvargo-go-envconfig — go get sethvargo-go-envconfig · libregistry