peterbourgon / ff

Flags-first package for configuration
Apache License 2.0
1.34k stars 59 forks source link

Fails to compile with Go 1.19~rc2 #96

Closed subpop closed 1 year ago

subpop commented 1 year ago

Fedora 37 (due to be released in the fall of 2022) updated to Go 1.19~rc2. The ff package started failing to compile; it looks like there's a breaking API change in the errors package:

./command_test.go:391:55: second argument to errors.As should not be *error
./command_test.go:409:51: second argument to errors.As should not be *error

You can see the full build log here and the automatically reported FTBFS bug here.

jolheiser commented 1 year ago

This can be "solved" by changing error to any (or interface{} in order to avoid changing go.mod) for the -As fields here https://github.com/peterbourgon/ff/blob/ec0e9e83d7894c370f9f377bf634527eaf182ad0/ffcli/command_test.go#L328-L334

I don't particularly like using any, which is less clear than error, but this is the sacrifice the go vet gods have demanded.

Let me know if you'd like a PR with these changes, but it may be worth a different refactor. Using any just seems like a code smell workaround.

peterbourgon commented 1 year ago

Wow, frustrating!

peterbourgon commented 1 year ago

https://github.com/peterbourgon/ff/releases/tag/v3.3.0