Skip to content

cmd/go: check casing of github user names in import paths #22291

@dlsniper

Description

@dlsniper

Hi,

Because the current specifications do not limit or prevent people to name their packages in any way, situations like sirupsen/logrus#553 happen when a project can be imported via github.com/sirupsen/logrus or via github.com/Sirupsen/logrus. There are many other instances of organization names or project names that have these issues, for example Netflix with https://github.com/netflix/chaosmonkey instead of the correct https://github.com/Netflix/chaosmonkey

Granted this is as much of a @github issue as is a Go tooling issue but it's quicker to fix Go than to break the Internet by getting Github to change their matching algorithm.

However I believe that specifying that packages should always be lowercase and if they are not they are converted automatically by the tooling that creates / downloads them from third party systems.

To make this as backwards compatible change, this could start be softly applied, e.g. go get and other tooling will always perform the lowercase transformation when downloading packages locally but the Go compiler or other existing tool is not changed until Go 2.0. Tools such as go vet or golint could meanwhile start to flag this as an issue so that people can gradually fix this.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions