• 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
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...