DataDog / datadog-go

go dogstatsd client library for datadog
MIT License
351 stars 134 forks source link

v5 is not importable from go mod enabled environment #231

Closed at-wat closed 2 years ago

at-wat commented 2 years ago

Importing github.com/DataDog/datadog-go v5.0.0 from other package causes an error like: go: github.com/DataDog/datadog-go/v5@v5.0.0: go.mod has non-.../v5 module path "github.com/DataDog/datadog-go" (and .../v5/go.mod does not exist) at revision v5.0.0

Official document about module path: https://golang.org/ref/mod#module-path

If the module is released at major version 2 or higher, the module path must end with a major version suffix like /v2. This may or may not be part of the subdirectory name. For example, the module with path golang.org/x/repo/sub/v2 could be in the /sub or /sub/v2 subdirectory of the repository golang.org/x/repo.

The usual solution is to update the module path in go.mod from module github.com/DataDog/datadog-go to module github.com/DataDog/datadog-go/v5 https://github.com/DataDog/datadog-go/blob/8eceabef48758063a04eed06f7ef3f04fe65d312/go.mod#L1

anopheles commented 2 years ago

See https://github.com/DataDog/datadog-go/pull/230 for a fix

hush-hush commented 2 years ago

This was fixed by #230