stretchr / testify

A toolkit with common assertions and mocks that plays nicely with the standard library
MIT License
22.5k stars 1.56k forks source link

error during install strechr/testify, undefined: errors.Is #1091

Open raghuiisc opened 3 years ago

raghuiisc commented 3 years ago

github.com/stretchr/testify/assert

/root/go/pkg/mod/github.com/stretchr/testify@v1.7.0/assert/assertions.go:1704:5: undefined: errors.Is /root/go/pkg/mod/github.com/stretchr/testify@v1.7.0/assert/assertions.go:1727:6: undefined: errors.Is /root/go/pkg/mod/github.com/stretchr/testify@v1.7.0/assert/assertions.go:1750:5: undefined: errors.As /root/go/pkg/mod/github.com/stretchr/testify@v1.7.0/assert/assertions.go:1767:7: undefined: errors.Unwrap /root/go/pkg/mod/github.com/stretchr/testify@v1.7.0/assert/assertions.go:1771:7: undefined: errors.Unwrap note: module requires Go 1.13

I am getting this error after i upgraded to "github.com/go-redis/redis/v8 v8.10.0"

brackendawson commented 3 years ago

It looks like you are using a go version lower than 1.13, is that right? Currently testify requires at least 1.13. Please run go env and paste the result.

raghuiisc commented 3 years ago

Thanks once i updated the go version it worked fine.

NamrataPatel29 commented 2 years ago

I updated my go version to 1.13 but my circle ci tests are still failing with the following error === Errors /go/pkg/mod/github.com/stretchr/testify@v1.7.0/assert/assertions.go:1704:5: undefined: errors.Is /go/pkg/mod/github.com/stretchr/testify@v1.7.0/assert/assertions.go:1727:6: undefined: errors.Is /go/pkg/mod/github.com/stretchr/testify@v1.7.0/assert/assertions.go:1750:5: undefined: errors.As /go/pkg/mod/github.com/stretchr/testify@v1.7.0/assert/assertions.go:1767:7: undefined: errors.Unwrap /go/pkg/mod/github.com/stretchr/testify@v1.7.0/assert/assertions.go:1771:7: undefined: errors.Unwrap note: module requires Go 1.13

can anyone help me with this?

brackendawson commented 2 years ago

@NamrataPatel29 your Circle CI is definitely not running go 1.13: https://golang.org/doc/go1.13#errors

NamrataPatel29 commented 2 years ago

@brackendawson yes it was not running go 1.13 , the issue got resolved when it ran go 1.13.

Also i am facing a similar issue whem i am tried updating another dependency (github.com/aws/aws-sdk-go from 1.30.23 to 1.40.10)

=== Errors /go/pkg/mod/golang.org/x/net@v0.0.0-20210614182718-04defd469f4e/http2/client_conn_pool.go:305:6: undefined: errors.Is note: module requires Go 1.17

does this require updation of go to 1.17 ? Isnt error.Is part of Go 1.13 ?

colin-valentini commented 2 years ago

This issue should be closed.