base16-universal-manager
base16-universal-manager copied to clipboard
Handle errors properly
We should not always just panic
For example, when misspelling the enabled
property value as "ture" instead of "true", I get a stack trace:
panic: yaml: unmarshal errors:
line 209: cannot unmarshal !!str `ture` into bool
goroutine 1 [running]:
main.check(...)
/home/ldh/.local/lib/go/src/github.com/binaryplease/base16-universal-manager/main.go:144
main.NewConfig(0xc00001e300, 0x36, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/ldh/.local/lib/go/src/github.com/binaryplease/base16-universal-manager/config.go:48 +0x3f7
main.main()
/home/ldh/.local/lib/go/src/github.com/binaryplease/base16-universal-manager/main.go:35 +0x78