https://github.com/robotomize/go-printenv
A command line utility that displays the environment variables used by a Go project
https://github.com/robotomize/go-printenv
ast cli env go golang golang-application parser tags
Last synced: 3 months ago
JSON representation
A command line utility that displays the environment variables used by a Go project
- Host: GitHub
- URL: https://github.com/robotomize/go-printenv
- Owner: robotomize
- License: apache-2.0
- Created: 2023-02-17T16:02:48.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-08T18:11:19.000Z (over 1 year ago)
- Last Synced: 2024-09-08T19:45:40.876Z (over 1 year ago)
- Topics: ast, cli, env, go, golang, golang-application, parser, tags
- Language: Go
- Homepage:
- Size: 44.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## goprintenv
A command line utility that displays the environment variables used by a Go project
### Status
The project is under development, it may not find all environment variables, keep this in mind when using it.
```shell
goprintenv -p
```
### Install
```shell
go install github.com/robotomize/go-printenv/cmd/goprintenv@latest
```
### Example
Currently only processes env tags
```go
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
```shell
LAST_NAME=IVANOV
TWO_LIVE=true
```
### @TODO
* 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