Although the Dockerfile is using golang:1.22-alpine, the go version in go.mod is still 1.21, which causing this error when running Mockery on my 1.22 codebase:
ERR encountered error when loading package error="-: This application uses version go1.21 of the source-processing packages but runs version go1.22 of 'go list'. It may fail to process source files that rely on newer language features. If so, rebuild the application using a newer version of Go." dry-run=false version=v2.40.3
Mockery Version
v2.40.3
Golang Version
1.22
Installation Method
[ ] Binary Distribution
[x] Docker
[ ] brew
[ ] go install
[ ] Other: [specify]
Steps to Reproduce
Create a go codebase with 1.22 and use the latest feature, like for i := range 10
Run Mockery on the codebase
Expected Behavior
There shouldn't have errors like the ones above.
Actual Behavior
ERR encountered error when loading package error="-: This application uses version go1.21 of the source-processing packages but runs version go1.22 of 'go list'. It may fail to process source files that rely on newer language features. If so, rebuild the application using a newer version of Go." dry-run=false version=v2.40.3
Description
Although the Dockerfile is using
golang:1.22-alpine
, the go version ingo.mod
is still1.21
, which causing this error when running Mockery on my 1.22 codebase:Mockery Version
v2.40.3
Golang Version
1.22
Installation Method
Steps to Reproduce
for i := range 10
Expected Behavior
There shouldn't have errors like the ones above.
Actual Behavior