go: x/vgo: vgo vendor doesn't complete with error: go.mod: go.mod:9: invalid module

~/src/github.com/prometheus/prometheus $ vgo vendor
vgo: finding github.com/oklog/oklog v0.0.0-20170918173356-f857583a70c3
vgo: finding gopkg.in/square/go-jose.v1/json v0.0.0-20160329203311-40d457b43924
vgo: gopkg.in/square/go-jose.v1/json v0.0.0-20160329203311-40d457b43924: missing go.mod
vgo: finding gopkg.in/square/go-jose.v1/cipher v0.0.0-20160329203311-40d457b43924
vgo: gopkg.in/square/go-jose.v1/cipher v0.0.0-20160329203311-40d457b43924: missing go.mod
vgo: finding github.com/oklog/oklog v0.0.0-20170918173356-f857583a70c3
vgo: parsing downloaded go.mod: go.mod:9: invalid module: github.com/djherbis/nio should be v1, not v2 (v2.0.3)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (12 by maintainers)

Most upvoted comments

This has reappeared somehow.


$ vgo build ./...
vgo: errors parsing go.mod:
/usr/local/google/home/cflewis/src/go/src/github.com/google/go-cloud/go.mod:46: invalid module: gopkg.in/yaml.v2 should be v1, not v2 (v2.2.1)

gopkg.in/yaml.v2 does have a go.mod file.

The go.mod file entry for this looks like gopkg.in/yaml.v2 v2.2.1

@djherbis Yes I meant vgo.

If you want to directly support vgo then all you have to do is go get -u golang.org/x/vgo (you must be using go >= 1.10) then vgo build your package then it should generate a go.mod file which you can commit (you need to do this for every major version >1). Also you would then have to make sure you have the proper git tags in the format vX.Y.Z where X Y Z are positive integers.

Supporting vgo also means v1 and v2+ can/will and must live together. So if there are any changes you have to take to allow that then you should make those changes.

Since the bug tracker is not for questions or discussions please post further questions in the proper places. https://github.com/golang/go/wiki/Questions

Also read the blogs to get a better understanding of vgo https://research.swtch.com/vgo

in your particular case it is a bug in vgo which should be fixed soon.

nothing needed from your side. Thanks