A command line utility that displays the environment variables used by a Go project
The project is under development, it may not find all environment variables, keep this in mind when using it.
goprintenv -p <go-project-source>
go install github.com/robotomize/go-printenv/cmd/goprintenv@latest
Currently only processes env tags
type Nested struct {
Live bool `env:"LIVE,default=true"`
}
type NestedStruct struct {
LastName string `env:"LAST_NAME,default=IVANOV" json:"last_name" bson:"lastName"`
Two Nested `env:",prefix=TWO_"`
}
The result will be the following
LAST_NAME=IVANOV
TWO_LIVE=true
- add ci, golangci-lint, Makefile, Dockerfile
- Implement parsing of built-in structures
- Should parse os.Getenv
- Support more env tags
- Refactor, simplify the code. Fix bugs and write unit tests