Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.
This repository has been archived by the owner on May 21, 2024. It is now read-only.

go.mod should have /v2 at the end of the module name #24

Closed
andig opened this issue Oct 31, 2019 · 3 comments · Fixed by #25
Closed

go.mod should have /v2 at the end of the module name #24

andig opened this issue Oct 31, 2019 · 3 comments · Fixed by #25

Comments

@andig
Copy link
Contributor

andig commented Oct 31, 2019

This is a follow-up of #19 which still appears broken. Consider this:

❯ go mod init foo
go: creating new go.mod: module foo

❯ go get github.com/influxdata/go-syslog@latest && cat go.mod 
module foo

go 1.13

require github.com/influxdata/go-syslog v1.0.1 // indirect

❯ go get github.com/influxdata/go-syslog@v2.0.0
go: finding github.com/influxdata/go-syslog v2.0.0
go get github.com/influxdata/go-syslog@v2.0.0: github.com/influxdata/go-syslog@v2.0.0: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v2

go get will never install a v2 version as the import path does not match. See https://github.com/golang/go/wiki/Modules#semantic-import-versioning for path names.

My feeling is that as this stage the right thing would be to release a 3.0 version (branched from 2.0) with a /v3 import path.

@andig
Copy link
Contributor Author

andig commented Oct 31, 2019

Right now this prevents porting telegraf to go modules (influxdata/telegraf#6118) as v1 doesn't have the required structure and v2 cannot be imported:

❯ go run cmd/telegraf/telegraf.go -debug -sample-config
build command-line-arguments: cannot load github.com/influxdata/go-syslog: module github.com/influxdata/go-syslog@latest found (v1.0.1), but does not contain package github.com/influxdata/go-syslog

@andig
Copy link
Contributor Author

andig commented Nov 1, 2019

/cc @leodido @elliotmr

@andig
Copy link
Contributor Author

andig commented Nov 1, 2019

Looks like 6b97c07 basically fixed the wrong thing. It should have worked before that commit.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant