vektra / mockery

A mock code autogenerator for Go
https://vektra.github.io/mockery/
BSD 3-Clause "New" or "Revised" License
5.8k stars 395 forks source link

Running mockery with docker does not work with go 1.22 #754

Closed ifross89 closed 4 months ago

ifross89 commented 4 months ago

Description

Currently using mockery via docker does not work on projects using go 1.22.

An example of the error is:

err: exit status 1: stderr: go: go.mod requires go >= 1.22 (running go 1.21.7; GOTOOLCHAIN=local)

09 Feb 24 10:19 UTC ERR unable to parse packages error="err: exit status 1: stderr: go: go.mod requires go >= 1.22 (running go 1.21.7; GOTOOLCHAIN=local)\n" dry-run=false version=v2.40.2

This happens because the toolchain in the Dockerfile is still at go 1.21.

Mockery Version

v2.40.2

Golang Version

1.22

NOTE: Please upgrade to the latest golang version before submitting tickets!

Installation Method

Steps to Reproduce

  1. attempt to run mockery via docker on a go 1.22 codebase, e.g. docker run -v $PWD:/src -w /src vektra/mockery:v2.40.2

Expected Behavior

The command to run successfully

Actual Behavior

An error occurs shown above