mvdan/interfacer

Support for multiple Go versions

Closed this issue · 1 comments

mvdan commented

Right now generate/std and consequently std.go run with Go 1.5.2, so all of 1.5 is covered since as far as I know there can't be any std API changes between 1.5 and 1.5.x.

We should generate one std.go per supported Go version and use build tags to select the correct one. We could start with 1.4 and 1.6.

mvdan commented

Actually, this is false. We want to suggest interface types present in the current stable Go release.

Grabbing the interface types from an older release would mean that we would be missing the ones from newer releases.

Grabbing them from the latest release means that we could make suggestions that may break packages on older Go versions, but that 's better than less suggestsions IMHO. If a suggestion breaks the build on any of the supported Go versions by a package, the suggestion simply should not be applied.

Using an older Go version is tempting, as it would avoid the latter case, but I think it's the worse scenario. Also, how far back is safe enough? 1.4? 1.3? Best not to decide.