go run main.go -c app.yml
works as expected and unmarshalls Remote.Host="a good host"
go run main.go -c app.yml -n "new host"
seems to have the correct structure when calling AllSettings, but unmarshal doesn't get set from the command line
go run main.go -c no-app.yml
panics
go run main.go -c no-app.yml -n "new host"
panics
go run main.go -n "new host"
panics
go run main.go
panics
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xd0 pc=0x750e25]
goroutine 1 [running]:
viper_test/vendor/github.com/spf13/viper.(*Viper).AllKeys(0x0, 0x30, 0x804c60, 0xc420175e01)
viper_test/vendor/github.com/spf13/viper/viper.go:1582 +0x45
viper_test/vendor/github.com/spf13/viper.(*Viper).AllSettings(0x0, 0x7492d1)
viper_test/vendor/github.com/spf13/viper/viper.go:1662 +0x51
viper_test/vendor/github.com/spf13/viper.(*Viper).Unmarshal(0x0, 0x781220, 0xc42009b060, 0x0, 0x0)
viper_test/vendor/github.com/spf13/viper/viper.go:759 +0x2f
main.main()
viper_test/main.go:36 +0x1bd
exit status 2