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

viper usage #5

Open
bdarge opened this issue Oct 28, 2020 · 0 comments
Open

viper usage #5

bdarge opened this issue Oct 28, 2020 · 0 comments

Comments

@bdarge
Copy link

bdarge commented Oct 28, 2020

I like your blueprint. I know the purpose of the blueprint is not about config but I think there is an issue in your viper usage. Without changing anything I created an image make container OS=linux, then I tried to create a docker container but I run to the following error.

panic: interface conversion: interface {} is nil, not string

goroutine 1 [running]:
github.com/bdarge/go-project-blueprint/cmd/blueprint/config.LoadConfig(0xc000161110, 0x1, 0x1, 0xcbc689, 0x2)
	/src/cmd/blueprint/config/config.go:37 +0x59f
main.main()
	/src/cmd/blueprint/main.go:39 +0x85

I guess one can do Config.DSN = v.Get("DSN").(string) only after config has read. I may be wrong.

@bdarge bdarge changed the title viper GET viper usage Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant