• Alex Brainman's avatar
    cmd/go/internal/load: use lowercase package directory comparisons on Windows · f7b625e4
    Alex Brainman authored
    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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    f7b625e4
Name
Last commit
Last update
..
addr2line Loading commit data...
api Loading commit data...
asm Loading commit data...
buildid Loading commit data...
cgo Loading commit data...
compile Loading commit data...
cover Loading commit data...
dist Loading commit data...
doc Loading commit data...
fix Loading commit data...
go Loading commit data...
gofmt Loading commit data...
internal Loading commit data...
link Loading commit data...
nm Loading commit data...
objdump Loading commit data...
pack Loading commit data...
pprof Loading commit data...
test2json Loading commit data...
trace Loading commit data...
vendor Loading commit data...
vet Loading commit data...