Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile list of missing variables before erroring #208

Closed
DeadlySurgeon opened this issue Jan 10, 2022 · 2 comments
Closed

Compile list of missing variables before erroring #208

DeadlySurgeon opened this issue Jan 10, 2022 · 2 comments

Comments

@DeadlySurgeon
Copy link

Parse should try to read each of the variables before failing when checking for required, so that way users do not have to enter each one manually and find each new required variable.

$ go run main.go
required environment variable "DB_PORT" is not set
$ DB_PORT=777 go run main.go
required environment variable "DB_HOST" is not set
$ DB_HOST="localhost" DB_PORT=777 go run main.go
required environment variable "DB_NAMESPACE" is not set

and so on.

Instead, in the above case:

$ go run main.go
required environment variables ["DB_PORT", "DB_HOST", "DB_NAMESPACE", ...] are not set

or

$ go run main.go
required environment variables [
    "DB_PORT",
    "DB_HOST", 
    "DB_NAMESPACE",
     ...
] are not set
@caarlos0
Copy link
Owner

this is a good one, although arguably a breaking change.

If anyone wants to work on a PR for this, I would be glad to review it.

@caarlos0
Copy link
Owner

fixed in #233

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants