Registry / config / codingconcepts-env

codingconcepts-env

JSON →
library0.0.0-20200821220118-a8fbf8d84482gogounverified

Package env populates struct fields from environment variables using struct tags.

go get github.com/codingconcepts/env
INSTALL
IMPORT
SIG · CODINGCONCEPTS-ENV
C
codingconcepts-env
configgov0.0.0-20200821220118-a8fbf8d84482
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/codingconcepts/env

Populate a Config struct from environment variables.

package main import ( "fmt" "github.com/codingconcepts/env" ) type Config struct { Port int `env:"PORT" required:"true"` } func main() { var cfg Config if err := env.Set(&cfg); err != nil { fmt.Println(err) } fmt.Printf("Port: %d\n", cfg.Port) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.0.0-20200821220118-a8fbf8d84482latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
38 hits · last 30 days
node
34
Resources
codingconcepts-env — go get codingconcepts-env · libregistry