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

go-winio module problem #156

Closed
Green7 opened this issue Aug 2, 2019 · 6 comments
Closed

go-winio module problem #156

Green7 opened this issue Aug 2, 2019 · 6 comments

Comments

@Green7
Copy link

Green7 commented Aug 2, 2019

I can't install go-winio module.
go version 1.12..7 on Windows, without go-winio on disc.
I create new project and execute:
go mod init test
go get github.com/microsoft/go-winio

go: github.com/microsoft/go-winio@v0.4.13: parsing go.mod: unexpected module path "github.com/Microsoft/go-winio"
go: error loading module requirements

@balboah
Copy link

balboah commented Sep 12, 2019

You can add this to your go.mod until its merged:

replace github.com/microsoft/go-winio => github.com/balboah/go-winio v0.4.14

@TBBle
Copy link
Contributor

TBBle commented Jan 2, 2021

The current name is github.com/Microsoft/go-winio, per https://github.com/microsoft/go-winio/blob/master/go.mod#L1, so this just looks like user error?

Looking across the Go projects in github.com/microsoft, it's a mixed bag of microsoft (20) vs Microsoft (14), and it seems that microsoft is canonical.

@TBBle
Copy link
Contributor

TBBle commented Jan 2, 2021

Go 1.13.8 gives a more-useful error in this case:

paulh@KEITARO:~/tt$ go version
go version go1.13.8 linux/amd64
paulh@KEITARO:~/tt$ go mod init test
go: creating new go.mod: module test
paulh@KEITARO:~/tt$ go get github.com/microsoft/go-winio
go: finding github.com/microsoft/go-winio v0.4.16
go: downloading github.com/microsoft/go-winio v0.4.16
go: extracting github.com/microsoft/go-winio v0.4.16
go get: github.com/microsoft/go-winio@v0.4.16: parsing go.mod:
        module declares its path as: github.com/Microsoft/go-winio
                but was required as: github.com/microsoft/go-winio
paulh@KEITARO:~/tt$ go get github.com/Microsoft/go-winio
go: finding github.com/Microsoft/go-winio v0.4.16
go: downloading github.com/Microsoft/go-winio v0.4.16
go: extracting github.com/Microsoft/go-winio v0.4.16
go: downloading golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3
go: extracting golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3
build golang.org/x/sys/windows: cannot load golang.org/x/sys/windows: no Go source files

(Users of x/sys/windows don't work on non-Windows, but that's a different issue)

@kevpar
Copy link
Member

kevpar commented Jan 5, 2021

The current name is github.com/Microsoft/go-winio, per https://github.com/microsoft/go-winio/blob/master/go.mod#L1, so this just looks like user error?

Looking across the Go projects in github.com/microsoft, it's a mixed bag of microsoft (20) vs Microsoft (14), and it seems that microsoft is canonical.

Unfortunately the organization was renamed a couple of years ago from Microsoft -> microsoft, which caused many issues for Go projects. We decided we wouldn't change the repo's casing, as that would break existing users, but there are certainly still issues when other projects use the lower-case org name.

@TBBle
Copy link
Contributor

TBBle commented Jan 5, 2021

Testing with go 1.15, even on Windows (case-insensitive filenames), go won't use a miscased module:

> go mod init test
go: creating new go.mod: module test
> go get github.com/microsoft/go-winio
go: downloading github.com/microsoft/go-winio v0.4.16
go: github.com/microsoft/go-winio upgrade => v0.4.16
go get: github.com/microsoft/go-winio@v0.4.16: parsing go.mod:
        module declares its path as: github.com/Microsoft/go-winio
                but was required as: github.com/microsoft/go-winio
> go version
go version go1.15.5 windows/amd64

So assuming the problem persists only with pre-modules Go packages, the ecosystem should clean itself over time, and certainly won't get any worse, unless people are deliberately making it worse bypassing the check with rules like

replace github.com/microsoft/go-winio => github.com/Microsoft/go-winio v0.4.16

except working.

I'm not seeing any issues with different repos from the same owner with different casing either.

> go get github.com/Microsoft/go-winio
go: github.com/Microsoft/go-winio upgrade => v0.4.16
> go get github.com/microsoft/moc
go: downloading github.com/microsoft/moc v0.10.5
go: github.com/microsoft/moc upgrade => v0.10.5

@kevpar
Copy link
Member

kevpar commented Jan 5, 2021

@TBBle Thanks for checking on this! Good to hear that it sounds like modules makes it easier to detect when the wrong casing is being used.

Since it sounds like this issue is resolved by using the correct casing in the go get invocation, I'm going to close this out.

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

Successfully merging a pull request may close this issue.

4 participants