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

go test fails with build error #537

Closed
rtfmoz2 opened this issue Apr 3, 2022 · 6 comments
Closed

go test fails with build error #537

rtfmoz2 opened this issue Apr 3, 2022 · 6 comments

Comments

@rtfmoz2
Copy link

rtfmoz2 commented Apr 3, 2022

rtfmoz@DESKTOP-H138G2U:/mnt/c/Users/Kevin/Projects/alpaca$ go test
# github.com/samuong/alpaca [github.com/samuong/alpaca.test]
./authenticator_test.go:87:15: undefined: io.ReadAll
FAIL    github.com/samuong/alpaca [build failed]
@rtfmoz2
Copy link
Author

rtfmoz2 commented Apr 3, 2022

It appears that ReadAll is no longer available under io. Further reading suggests to use ioutil instead.

@blgm
Copy link
Collaborator

blgm commented Apr 3, 2022

It's the other way around. ioutil was deprecated in Go 1.16, and io.ReadAll was added.

I can't see anything in the error message that suggests this is to do with Gomega. Am I missing something?

@rtfmoz2
Copy link
Author

rtfmoz2 commented Apr 3, 2022

I know right, but io.ReadAll stopped working and ioutils.ReadAll works. Go figure. I don't know how this issue ended up here, I posted it over at alpaca so you can close it if you think its a non-issue

@rtfmoz2
Copy link
Author

rtfmoz2 commented Apr 3, 2022

See this conversations

#488 and
#492

@blgm
Copy link
Collaborator

blgm commented Apr 3, 2022

I guess it's worth checking the Go version that's being used. It also might be worth checking whether there are any other versions of Go on the system, as sometimes a test might modify the PATH and end up using a different version of Go than you thought you were using.

Gomega uses build tags so that ioutil is used for Go 1.15 and earlier, and io.ReadAll for Go 1.16 and higher. It's possible that this has gone wrong, but the error message is pointing to "./authenticator_test.go:87:15" which I don't think is part of Gomega.

@rtfmoz2
Copy link
Author

rtfmoz2 commented Apr 3, 2022

I installed go today and picked up this issue, version 1.18 windows/amd64, oh I see the issue. the wsl version of GO is 1.13. solved.

@rtfmoz2 rtfmoz2 closed this as completed Apr 3, 2022
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

No branches or pull requests

2 participants