Skip to content

module required error when get module in multi module repo mode #42

@chengjingtao

Description

@chengjingtao

Hi, I have a module mode repo like this:

// repo: https://git.mycompany.com/dev/pkg.git

├── README.md
├── go.mod    // go.mycompany.com/pkg
├── util
│   ├── go.mod   // go.mycompany.com/pkg/util
│   ├── go.sum
│   ├── xx.go
├── log
│   ├── go.mod    // go.mycompany.com/pkg/log
│   ├── go.sum
│   └── xx.go

I have add config in vanity.yaml

paths:
  /pkg/util:
    repo: https://git.mycompany.com/dev/pkg

but When execute command go get -v go.company.com/pkg/util , I got error

get "go.company.com/pkg": found meta tag get.metaImport{Prefix:"go.company.com/pkg", VCS:"git", RepoRoot:"https://git.mycompany.com/dev/pkg"} at //git.mycompany.com/pkg?go-get=1
get "go.company.com/pkg/util": found meta tag get.metaImport{Prefix:"go.company.com/pkg/util", VCS:"git", RepoRoot:"https://git.mycompany.com/dev/pkg"} at //git.mycompany.com/pkg/util?go-get=1
go: go.mycompany.com/pkg/util master => v0.1.2-0.20210120054534-86b99a469841
go get: go.mycompany.com/pkg/[email protected]: parsing go.mod:
	module declares its path as: go.mycompany.com/pkg
	        but was required as: go.mycompany.com/pkg/util

Is there any idea to resolve it ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions