Closed deluan closed 8 years ago
This var here is passed as a nil pointer here.
Looking at the stacktrace I think error originates from github.com/fatih/structs and probably it should be reported upstream.
The var is initialized in the init() function. I'll try to debug the structs
package and see if I can find the problem.
I've created a small program using the example code from the README, and it gives the same error when called with -help
.
It's issue with github.com/fatih/structs, the check for IsExported should be adapted as described in golang.org/issue/12367.
golang/go#12367 says:
Code that assumes
f.PkgPath != nil
means a field is unexported and must be ignored must now be revised to check for
f.PkgPath != nil && !f.Anonymous
for it to walk into the embedded structs to look for exported fields contained within.
@deluan I've sent https://github.com/koding/multiconfig/pull/51 to fix this issue. I was wrong, it's not handling of exported fields in fatih/structs reason for this panic, but the new behaviour of flag package.
After upgrading to Go 1.7 (and 1.7.1),
-help
gives a panic:For reference, my code is available here: https://github.com/deluan/gosonic/blob/master/conf/configuration.go