Skip to content
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

Fixed travis test failing for older versions of go #604

Merged
merged 2 commits into from
Oct 24, 2018
Merged

Fixed travis test failing for older versions of go #604

merged 2 commits into from
Oct 24, 2018

Conversation

teddy-codes
Copy link
Contributor

Older versions of go were making tests fail due to golint.
Post v1.6 of go, golint changed to an official repo.

Error before change:

golang.org/x/tools/go/internal/gcimporter
../../../golang.org/x/tools/go/internal/gcimporter/bexport.go:212: obj.IsAlias undefined (type *types.TypeName has no field or method IsAlias)
The command "go get -v golang.org/x/lint/golint" failed and exited with 2 during .

pre v1.9, this method was not present.
References:

.travis.yml Outdated
script:
- diff <(gofmt -d .) <(echo -n)
- go vet -x ./...
- golint -set_exit_status ./...
- golint -set_exit_status ./... || true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this ignore the result of golint now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, good point. I will see if I can do something regarding this. If you have a look at the conversation, it is simply a problem with older versions of go (since the function that is causing the error was introduced in v1.9)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do think that this should be "optional" though

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I'm happy for lint to not fail, I just want gofmt to be enforced, if we add a format check that would be fine too.

Copy link
Contributor Author

@teddy-codes teddy-codes Oct 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am thinking to add a bash script with this regex for go version: go[1-9].[1-9]?[0-9].[0-9]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will have to be updated upon version update though...

@iopred iopred merged commit 797adee into bwmarrin:develop Oct 24, 2018
@iopred
Copy link
Collaborator

iopred commented Oct 24, 2018

Thank you so much!

@teddy-codes teddy-codes deleted the feature/travis/fix branch October 24, 2018 22:19
@bwmarrin bwmarrin added this to the v0.19.0 milestone Nov 2, 2018
@jsoref jsoref mentioned this pull request Apr 7, 2019
ErikMcClure pushed a commit to ErikMcClure/discordgo that referenced this pull request Aug 4, 2020
* Fixed travis test failing for older versions of go

* changed supported go version
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.

3 participants