-
Notifications
You must be signed in to change notification settings - Fork 3
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
Register mandatory and non-mandatory env vars #22
Conversation
3aaf3e0
to
6512a16
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super cool stuff!
Only small changes below. Furthermore, I believe you need to run dep ensure
to update Gopkg files as you introduced envconfig
.
server/web/main.go
Outdated
// Specification represents a map of enviornment variables | ||
type Specification struct { | ||
UserPassword string `envconfig:"USERPASSWD" required:"true"` | ||
EncryptionKey string `split_words:"true" required:"true"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Better to use envconfig:"ENCRYPTION_KEY"
than split_words (which ends up doing the same thing, but indirectly).
Same bellow.
} | ||
key := []byte(os.Getenv("ENCRYPTION_KEY")) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Log the environment variables/config?
fmt.Printf("%+v", spec) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to log it.. dammit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@danielfireman done (: |
Thanks a lot, @lucasgomide ! :D |
This commit closes issue #21
This change is