Skip to content

Can't import the otel package #4185

@alexandear

Description

@alexandear

I'm trying to import the otel package from this repository into a Go program, but I'm unable to do so. I tried the following commands:

go get github.com/google/go-github/v85/otel
go: module github.com/google/go-github/v85@upgrade found (v85.0.0), but does not contain package 
github.com/google/go-github/v85/otelgo get github.com/google/go-github/otel
go: downloading github.com/google/go-github/otel v0.0.0-20260430203823-b7b1f86d59fa
go: github.com/google/go-github/otel@upgrade (v0.0.0-20260430203823-b7b1f86d59fa) requires github.com/google/go-github/otel@v0.0.0-20260430203823-b7b1f86d59fa: parsing go.mod:
        module declares its path as: github.com/google/go-github/v85/otel
                but was required as: github.com/google/go-github/otel

It looks like the issue is caused by missing otel/vX.Y.Z Git tags in the repository. According to the "Mapping versions to commits" documentation:

If a module is defined in a subdirectory within the repository, that is, the module subdirectory portion of the module path is not empty, then each tag name must be prefixed with the module subdirectory, followed by a slash. For example, the module golang.org/x/tools/gopls is defined in the gopls subdirectory of the repository with root path golang.org/x/tools. The version v0.4.0 of that module must have the tag named gopls/v0.4.0 in that repository.

So for github.com/google/go-github/v85/otel, Go expects tags like otel/vX.Y.Z. The otel/ prefix is mandatory.

Since the otel package can't currently be imported, I'm wondering if anyone is actually using it. If not, perhaps it could be removed? It has been added in #3938.

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