arp242 / uni

Query the Unicode database from the commandline, with good support for emojis
MIT License
790 stars 19 forks source link

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

Closed maxlath closed 2 years ago

maxlath commented 2 years ago

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/zli@v0.0.0-20210330134141-b5f2a73532d6/test.go:84:3: t.Cleanup undefined (type *testing.T has no field or method Cleanup)
arp242 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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.