Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract canonical import path from .go files #53

Closed
jayconrod opened this issue Dec 26, 2017 · 4 comments
Closed

Extract canonical import path from .go files #53

jayconrod opened this issue Dec 26, 2017 · 4 comments

Comments

@jayconrod
Copy link
Contributor

Migrated from bazelbuild/rules_go#874

See https://golang.org/doc/go1.4#canonicalimports

Go implementation: findImportComment

@psalaberria002
Copy link

@purkhusid
Copy link
Contributor

I'm hitting the same issue when trying to use OpenTelemetry packages. Are ther any known workarounds?

@psalaberria002
Copy link

I'm hitting the same issue when trying to use OpenTelemetry packages. Are ther any known workarounds?

I think it got fixed for us when we upgraded to the latest version.

$ cat go.mod | grep opent
        go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.40.0
        go.opentelemetry.io/otel v1.14.0
        go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0
        go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0
        go.opentelemetry.io/otel/sdk v1.14.0
        go.opentelemetry.io/otel/trace v1.14.0
        github.com/opentracing/opentracing-go v1.2.0 // indirect
        go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0 // indirect
        go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0 // indirect
        go.opentelemetry.io/proto/otlp v0.19.0 // indirect

@jayconrod
Copy link
Contributor Author

This issue shouldn't be relevant anymore now that GOPATH is mostly dead.

It was referring specifically to comments like this:

package otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlpconfig"

Before Go modules, the go tool checked that if the canonical import path was set, it matched the directory within $GOPATH. It was possible to download a package to the wrong path manually or by using a non-canonical path that mapped to the same repository like github.com/open-telemetry/opentelemetry-go.

This issue was meant to add that feature to Gazelle, but since GOPATH is basically deprecated, and modules don't support canonical import paths (the module path in go.mod serves that purpose), this feature isn't needed.

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

No branches or pull requests

3 participants