• Russ Cox's avatar
    cmd/go: apply same per-package flags to compile and link of test · 2c296dc8
    Russ Cox authored
    If package strings has a particular set of gcflags, then the strings_test
    pseudo-package built as part of the test binary started inheriting the
    same flags in CL 81496, to fix #22831.
    
    Now the package main and final test binary link built as part of the
    strings test binary also inherit the same flags, to fix #22994.
    
    I am slightly uneasy about reusing package strings's flags for
    package main, but the alternative would be to introduce some
    kind of special case, which I'd be even more uneasy about.
    
    This interpretation preserves the Go 1.9 behavior of existing
    commands like:
    
    	go test -c -ldflags=-X=mypkg.debugString=foo mypkg
    
    Fixes #22994.
    
    Change-Id: I9ab83bf1a9a6adae530a7715b907e709fd6c1b5d
    Reviewed-on: https://go-review.googlesource.com/83879
    Run-TryBot: Russ Cox <rsc@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    2c296dc8
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...