]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/load: use lowercase package directory comparisons on Windows
authorAlex Brainman <alex.brainman@gmail.com>
Tue, 24 Apr 2018 23:15:25 +0000 (09:15 +1000)
committerAlex Brainman <alex.brainman@gmail.com>
Sat, 26 May 2018 07:56:52 +0000 (07:56 +0000)
commitf7b625e4cb363c23ed5c8c144ee7d06c4136a0eb
treeab3ae5a47ff1f97c8e66dee4039927b2e0a175b5
parentdbafdac0c11fa569b2143f896f169d1e37fc311c
cmd/go/internal/load: use lowercase package directory comparisons on Windows

go build

command is short for

go build .

and it builds . package. When command above is executed from
directory inside of GOPATH, it uses GOPATH to calculate package
source directory. So . package uses GOPATH as part of package
source directory.

On the other hand

go build -ldflags=abc

only passes flag to the linker for packages that are listed
on the command line. The command above assumes . package again,
and that package source path is compared with current directory.

Current code compares result of os.Getwd with what GOPATH
environment variable contains. But these values might differ
in letter case on Windows. For example, one might return
c:\gopath\..., while the other might contain C:\GOPATH.

Fixes #24750
Fixes #24232
Fixes #25046

Change-Id: I03d8c7a9b73e847f88ae61c88cd41efa546c6d0e
Reviewed-on: https://go-review.googlesource.com/109235
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/go/go_test.go
src/cmd/go/internal/load/search.go