Skip to content

Rename go version dependent sources using idiomatic naming #822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

dolmen
Copy link
Contributor

@dolmen dolmen commented Jun 15, 2018

Description

The Go toolchain has special support for build tags for Go versions in source filenames.
This makes build tags redundant, so they are removed.

Checklist

  • Code compiles correctly
  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary
  • Added myself / the copyright holder to the AUTHORS file

The Go toolchain has special support for build tags for Go versions in
source filenames.
https://golang.org/pkg/go/build/#hdr-Build_Constraints
This makes build tags redundant, so they are removed.
@dolmen dolmen force-pushed the use-filenames-for-build-tags branch from 6c287be to 6eb2824 Compare June 15, 2018 09:27
@methane
Copy link
Member

methane commented Jun 15, 2018

Can we drop Go 1.7 support in next release?

@julienschmidt
Copy link
Member

Can we drop Go 1.7 support in next release?

yes

@shogo82148
Copy link
Contributor

shogo82148 commented Jun 16, 2018

The Go toolchain has special support for build tags for Go versions in source filenames.

The job https://travis-ci.org/go-sql-driver/mysql/jobs/392633176 fails.

https://golang.org/pkg/go/build/#hdr-Build_Constraints
If a file's name, after stripping the extension and a possible _test suffix, matches any of the following patterns:
*_GOOS
*_GOARCH
*_GOOS_GOARCH

As you have said that Go toolchain has special support in source filename, but *_GOVERSION is not in the patterns list.
So, // +build go1.8 is required, isn't it?

@dolmen
Copy link
Contributor Author

dolmen commented Jun 16, 2018

It appears I had an incorrect understanding of the build documentation: there is no magic for go versions in filenames.

@dolmen dolmen closed this Jun 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants