go-winio module problem
Green7 opened this issue · 6 comments
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
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
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.
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)
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) vsMicrosoft
(14), and it seems thatmicrosoft
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.
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