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

x/pkgsite: ignore import path casing #45140

Closed
pashaosipyants opened this issue Mar 20, 2021 · 3 comments
Closed

x/pkgsite: ignore import path casing #45140

pashaosipyants opened this issue Mar 20, 2021 · 3 comments
Labels
FrozenDueToAge pkgsite WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@pashaosipyants
Copy link

pkg.go.dev regards the case of the package import path
see examples below

What version of Go are you using (go version)?

irrelevant

Does this issue reproduce with the latest release?

irrelevant

What operating system and processor architecture are you using (go env)?

irrelevant

What did you do?

irrelevant

What did you expect to see?

https://pkg.go.dev/github.com/reactivex/rxgo
https://pkg.go.dev/github.com/ReactiveX/RxGo

no difference between pages by these 2 links

What did you see instead?

https://pkg.go.dev/github.com/ReactiveX/RxGo - does not contain info about v2
This is actually very confusing. I've spent some time learning RxGo v1, because the link above said it's the latest version... :(

@seankhliao seankhliao changed the title pkg.go.dev - Ignore case of package path x/pkgsite: ignore import path casing Mar 20, 2021
@gopherbot gopherbot added this to the Unreleased milestone Mar 20, 2021
@julieqiu
Copy link
Member

I would recommend asking the authors to request for github.com/ReactiveX/RxG to be excluded from pkg.go.dev, per https://go.dev/about#removing-a-package.

The reason that both versions appear is because github.com/ReactiveX/RxG does not have a go.mod file at v1.0.0. At that version, both github.com/ReactiveX/RxG and github.com/reactivex/rxg are valid module paths. If pkg.go.dev were to redirect, it's not clear which one would be the "canonical" path.

A go.mod file was added in ReactiveX/RxGo@0994d7f#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6 for v2, with the module path github.com/reactivex/rxgo/v2.

Once the go.mod file was added, github.com/ReactiveX/RxGo/v2 was no longer a valid module path. https://pkg.go.dev/github.com/ReactiveX/RxGo/v2 redirects to https://pkg.go.dev/github.com/reactivex/rxgo/v2 as a result.

@julieqiu julieqiu added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Mar 22, 2021
@jba
Copy link
Contributor

jba commented Mar 22, 2021

Just to add to Julie's comments: case is, and always has been, significant in import paths. Thus it would be wrong for us (or any go tool) to treat paths case-insensitively.

GitHub does treat repo URLs case-insensitively, which causes the kind of problems you're seeing. The presence of a go.mod file fixes those problems by establishing the definitive import path. But without the go.mod file, pkg.go.dev (or any go tool) cannot tell what the right import path is.

@pashaosipyants
Copy link
Author

@julieqiu @jba
Thx guys for your answers!
Will address this issue to ReactiveX owners.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge pkgsite WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants