qur / withmock

Automatic Go package mock generation tool
Other
71 stars 9 forks source link

Complicated project : Package is not found #63

Open drfunjohn opened 4 years ago

drfunjohn commented 4 years ago

go version go1.13.4 linux/amd64 GO111MODULE=on GOPATH=/home/ubuntu/go

My project use: go mod vendor

Tree: MyProject |_ db |_pkg | |_api |vendor | main.go

When I run test from root directory of project by: mocktest -debug ./pkg/api/

I recieve next error:

....... 2019/12/12 10:31:42 installImports: label: github.com/spf13/cobra, name: github.com/spf13/cobra, mock: false 2019/12/12 10:31:42 GenPkg: srcPath:/home/ubuntu/go, dstRoot:/tmp/withmock781383690/path, name:github.com/spf13/cobra, mock:false ERROR(AddPackage:installImports:GenPkg): Package 'github.com/spf13/cobra' not found in any of '/home/ubuntu/go'.

If I run from api directory: cd pkg/api withmock -debug go test

Each time random package appears in the error.

Thanx.