Skip to content

Complicated project : Package is not found #63

@drfunjohn

Description

@drfunjohn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions