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

installation fails with " t.Cleanup undefined (type *testing.T has no field or method Cleanup)" #29

Closed
maxlath opened this issue Oct 5, 2021 · 4 comments

Comments

@maxlath
Copy link

maxlath commented Oct 5, 2021

hi :)

Env

go version go1.13.8 linux/amd64

Bug

running go build produces the following output and exits with a non-zero code

go: downloading zgo.at/zstd v0.0.0-20210322015326-ca7824321150
go: downloading zgo.at/zli v0.0.0-20210330134141-b5f2a73532d6
go: extracting zgo.at/zstd v0.0.0-20210322015326-ca7824321150
go: extracting zgo.at/zli v0.0.0-20210330134141-b5f2a73532d6
go: downloading golang.org/x/term v0.0.0-20210317153231-de623e64d2a6
go: extracting golang.org/x/term v0.0.0-20210317153231-de623e64d2a6
go: downloading golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005
go: extracting golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005
go: finding zgo.at/zstd v0.0.0-20210322015326-ca7824321150
go: finding zgo.at/zli v0.0.0-20210330134141-b5f2a73532d6
go: finding golang.org/x/term v0.0.0-20210317153231-de623e64d2a6
go: finding golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005
# zgo.at/zli
../../.go/pkg/mod/zgo.at/[email protected]/test.go:84:3: t.Cleanup undefined (type *testing.T has no field or method Cleanup)
@arp242
Copy link
Owner

arp242 commented Oct 5, 2021

T.Cleanup was added in Go 1.14, so you need at least Go 1.14. It's possible that you actually need a newer version for other things; I'm not 100% sure off-hand.

Go 1.13 is two years old, and compatibility is highly valued. You shouldn't have any problems updating to a newer version.

@arp242 arp242 closed this as completed in af3fc40 Oct 5, 2021
@arp242
Copy link
Owner

arp242 commented Oct 5, 2021

I confirmed it compiles with Go 1.14, and added a more explicit error when you're trying to use an older version with a work-around I used earlier, so this should at least clarify things in the future.

Supporting older versions of Go isn't really something I want to spend time on I'm afraid; I know some distros use rather old Go versions, but it's easy to install a newer version and since compatibility is highly valued this is rarely (if ever) a problem too. It's also not a 2-minute fix in this case since the problem is in a dependency (a dependency I maintain, but still, and the Cleanup function simplifies a few things). And you can also use the binary downloads of course; since they're statically built they should work on any Linux system.

@maxlath
Copy link
Author

maxlath commented Oct 5, 2021

That's indeed what Ubuntu 20.04 offers by default >< But, for any future readers, a more recent go version can be installed via a ppa, and now it works just fine. Thanks for the quick answer!

@arp242
Copy link
Owner

arp242 commented Oct 5, 2021

Cheers; it's also easy to download/install from the golang.org website.

I understand why Ubuntu, Debian, etc. want to offer a long-term stable version, but it's pretty annoying as these Go versions aren't even supported by the Go team any more, and newer versions often add useful new features and I'd rather not wait 3+ years for all distros to catch up. I added the binary downloads largely for this reason.

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