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

pathlib values undefined #743

Closed davidsbond closed 6 months ago

davidsbond commented 6 months ago

Description

While trying to install mockery I am getting the following error:

Error: ../../../go/pkg/mod/github.com/vektra/mockery/v2@v2.39.1/pkg/config/config.go:561:33: undefined: pathlib.AlgorithmPreOrderDepthFirst
Error: ../../../go/pkg/mod/github.com/vektra/mockery/v2@v2.39.1/pkg/config/config.go:596:20: undefined: pathlib.ErrWalkSkipSubtree

Mockery Version

v2.39.1

Golang Version

1.21

Installation Method

Steps to Reproduce

  1. Try to install mockery v2.39.1 via go install github.com/vektra/mockery/v2
  2. See error

Expected Behavior

The binary is built & installed

Actual Behavior

Compilation error as shown above.

davidsbond commented 6 months ago

Somehow my go.mod ended up with the incorrect version of pathlib as a transient dependency. After I tweaked that to match the version mockery uses the installation works again

LandonTClipp commented 5 months ago

Sounds good, feel free to post other issues if you find them.

percivalalb commented 5 months ago

I've also just had this happen to me, it seems that the retract section of the go.mod file isn't always respected https://github.com/chigopher/pathlib/blob/master/go.mod#L20 . Looks like an issue with the go toolchain, I'll see if I can recreate and make an upstream issue.

For others, I forced the version to match the same version that mockery also uses.

$ go get github.com/chigopher/pathlib@v0.19.1
go: downgraded github.com/chigopher/pathlib v1.0.0 => v0.19.1