Robert Griesemer [Mon, 15 Jun 2015 19:49:45 +0000 (12:49 -0700)]
go/types: fix Eval to use correct file set when evaluating an expression
This is https://go-review.googlesource.com/10999 which we could not apply
in x/tools/go/types because we must not rely on 1.5 features in that repo
yet.
Change-Id: I9a57cdb7ad4051df278d1fbed90c736df50f426f
Reviewed-on: https://go-review.googlesource.com/11125 Reviewed-by: Alan Donovan <adonovan@google.com>
Robert Griesemer [Mon, 15 Jun 2015 18:06:59 +0000 (11:06 -0700)]
go/types: port recent x/tools/go/types fixes
The main change is:
golang.org/cl/10800 add pos parameter to Eval; remove New, EvalNode
followed by several cleanups/follow-up fixes:
golang.org/cl/10992 remove global vars in test
golang.org/cl/10994 remove unused scope parameter from NewSignature
golang.org/cl/10995 provide full source file extent to file scope
golang.org/cl/10996 comment fix in resolver.go
golang.org/cl/11004 updated cmd/vet
golang.org/cl/11042 be robust in the presence of incorrect/missing position info
Fixes #9980.
Change-Id: Id4aff688f6a399f76bf92b84c7e793b8da8baa48
Reviewed-on: https://go-review.googlesource.com/11122 Reviewed-by: Alan Donovan <adonovan@google.com>
Brad Fitzpatrick [Mon, 15 Jun 2015 19:46:04 +0000 (12:46 -0700)]
cmd/go: fix typo
Change-Id: I171a1125e25b13c934c2cd545bd03f49f642910d
Reviewed-on: https://go-review.googlesource.com/11113 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Ian Lance Taylor [Mon, 15 Jun 2015 18:35:56 +0000 (11:35 -0700)]
syscall: fix TestCloneNEWUSERAndRemapNoRootDisableSetgroups the right way
The problem was not the kernel version as I thought before, it was
that the test used the same number for both the UID and the GID.
Thanks to Chris Siebenmann for debugging this.
Russ Cox [Fri, 5 Jun 2015 03:47:01 +0000 (23:47 -0400)]
cmd/go: make -a apply to the standard library, like in Go 1.3
This CL adds a very long comment explaining how isStale and
the new build IDs work. As part of writing the comment I realized:
// When the go command makes the wrong build decision and does not
// rebuild something it should, users fall back to adding the -a flag.
// Any common use of the -a flag should be considered prima facie evidence
// that isStale is returning an incorrect false result in some important case.
// Bugs reported in the behavior of -a itself should prompt the question
// ``Why is -a being used at all? What bug does that indicate?''
The two uses of -a that are most commonly mentioned in bugs filed
against the go command are:
go install -a ./...
go build -tags netgo -a myprog
Both of these commands now do the right thing without needing -a.
The -a exception we introduced in Go 1.4 was for the first form, and
it broke the second form. Again, neither needs -a anymore, so restore
the old, simpler, easier to explain, less surprising meaning used in Go 1.3:
if -a is given, rebuild EVERYTHING.
See the comment for more justification and history.
Summary of recent CLs (to link bugs to this one):
Fixes #3036. Now 'go install ./...' works.
Fixes #6534. Now 'go install ./...' works.
Fixes #8290. Now 'go install ./...' works.
Fixes #9369. Now 'go build -tags netgo myprog' works.
Fixes #10702. Now using one GOPATH with Go 1.5 and Go 1.6 works.
(Each time you switch, everything needed gets rebuilt.
Switching from Go 1.4 to Go 1.5 will rebuild properly.
Switching from Go 1.5 back to Go 1.4 still needs -a when
invoking the Go 1.4 go command.)
Change-Id: I19f9eb5286efaa50de7c8326602e94604ab572eb
Reviewed-on: https://go-review.googlesource.com/10761 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Russ Cox [Thu, 4 Jun 2015 19:35:58 +0000 (15:35 -0400)]
cmd/go: include Go toolchain information in build ID
This causes packages and binaries built by Go 1.5 to look
out of date to Go 1.6 and vice versa, so that when you flip
between different Go versions but keep the same GOPATH,
the right rebuilding happens at each flip.
Go 1.4 binaries will also look out of date to Go 1.5,
but Go 1.5 binaries will not look out of date to Go 1.4
(since Go 1.4 doesn't have anything like this).
People flipping between Go 1.4 and Go 1.5 will still
need to use go install -a every time to flip to Go 1.4,
but not when they flip back to Go 1.5.
Fixes #6534.
Fixes #10702.
Change-Id: I0ae7f268f822d483059a938a4f22846ff9275b4c
Reviewed-on: https://go-review.googlesource.com/10760 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org>
Srdjan Petrovic [Tue, 9 Jun 2015 21:36:05 +0000 (14:36 -0700)]
cmd/go: force-overwrite destination files when installing cgo headers
Fixes #11131
When running 'go install -buildmode=c-shared', under the circumstances
described in issue #11131, the install command would fail trying to
install cgo headers if they have already been installed (by a previous
call to 'go install -buildmode=c-shared').
Since it's safe to overwrite said headers (according to iant@), this CL
introduces a parameter to builder's 'copy' and 'move' functions that,
if set to 'true', would force the overwriting of already installed
files.
This parameter value is set to 'true' only when installing cgo headers,
for now.
Change-Id: I5bda17ee757066a8e5d2b39f2e8f3a389eb1e4a2
Reviewed-on: https://go-review.googlesource.com/10870
Run-TryBot: Srdjan Petrovic <spetrovic@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Rob Pike [Mon, 15 Jun 2015 17:59:00 +0000 (10:59 -0700)]
testing: don't print CPU count for tests, only benchmarks
The number of CPUs is of value when benchmarking but mostly
noise when testing. The recent change to default to the number
of CPUs available has made the tests noisier and confusing.
Russ Cox [Mon, 8 Jun 2015 02:14:04 +0000 (22:14 -0400)]
cmd/cgo: make sure pointers passed to C escape to heap
Fixes #10303.
Change-Id: Ia68d3566ba3ebeea6e18e388446bd9b8c431e156
Reviewed-on: https://go-review.googlesource.com/10814 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Russ Cox [Mon, 8 Jun 2015 02:47:59 +0000 (22:47 -0400)]
runtime: use type-based write barrier for remote stack write during chansend
A send on an unbuffered channel to a blocked receiver is the only
case in the runtime where one goroutine writes directly to the stack
of another. The garbage collector assumes that if a goroutine is
blocked, its stack contains no new pointers since the last time it ran.
The send on an unbuffered channel violates this, so it needs an
explicit write barrier. It has an explicit write barrier, but not one that
can handle a write to another stack. Use one that can (based on type bitmap
instead of heap bitmap).
To make this work, raise the limit for type bitmaps so that they are
used for all types up to 64 kB in size (256 bytes of bitmap).
(The runtime already imposes a limit of 64 kB for a channel element size.)
I have been unable to reproduce this problem in a simple test program.
Alex Schroeder [Sun, 14 Jun 2015 10:54:05 +0000 (12:54 +0200)]
wiki article: remove "flag" import from the code
When reading along the article, the extra code added in the final
version is not explained. The main function calls flag.Parse(), for
example, which will cause an error, unless the readers looks at the
entirety of final.go to see the import added.
The file shown to the users no longer has the extra flags. The testing
code is now in a patch that gets applied to final.go in order to create
final-test.go. This is the file that will be used to test the code,
matching final.go as much as possible.
Change-Id: I022f5f6c88e107c8ba5623661d74a8d260d05266
Reviewed-on: https://go-review.googlesource.com/11061 Reviewed-by: Andrew Gerrand <adg@golang.org>
Dmitry Vyukov [Sun, 14 Jun 2015 20:58:54 +0000 (22:58 +0200)]
cmd/trace: fix panic in goroutine profile
In generateTrace we check that event timestamp is within the interesting range.
Then later in traceContext.time we double check event time.
However, for some events (e.g. emitSlice) we convert time of ev.Link (slice end) rather than ev itself (slice begin).
Slice end can be outside of the interesting time range, and so traceContext.time crashes.
Remove the check in traceContext.time, check in generateTrace loop is sufficient.
Change-Id: If94e93b5653c5816c0a8dcdd920f15df97616835
Reviewed-on: https://go-review.googlesource.com/11100 Reviewed-by: Andrew Gerrand <adg@golang.org>
Adam Langley [Sun, 14 Jun 2015 15:15:41 +0000 (08:15 -0700)]
crypto/tls: fix parsing of SNI extension.
The previous code had a brain fart: it took one of the length prefixes
as an element count, not a length. This didn't actually affect anything
because the loop stops as soon as it finds a hostname element, and the
hostname element is always the first and only element. (No other element
types have ever been defined.)
This change fixes the parsing in case SNI is ever changed in the future.
Mikio Hara [Fri, 29 May 2015 22:33:16 +0000 (07:33 +0900)]
net: don't return non-nil interface values as Source, Addr in OpError
Fixes #10992.
Change-Id: Ia376e4de118993b43e5813da57ab25fea8122048
Reviewed-on: https://go-review.googlesource.com/10476 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Robert Griesemer [Fri, 12 Jun 2015 23:33:49 +0000 (16:33 -0700)]
go/parser: add ParseExprFrom function
This is needed for code that relies on having the correct file set
when parsing an expression only. There's currently no other way to
get to the file set otherwise or to invoke the parser correctly to
work on an expression only with a given file set.
Change-Id: I325f174cb34b69284e627f59fe8334efa4eaa45c
Reviewed-on: https://go-review.googlesource.com/10998 Reviewed-by: Alan Donovan <adonovan@google.com>
Ian Lance Taylor [Fri, 12 Jun 2015 23:41:46 +0000 (16:41 -0700)]
doc/go1.5.txt: mention GidMappingsEnableSetgroups in linux SysProcAttr
Change-Id: I412621497902fa36f4939df392b10ca7040fc36e
Reviewed-on: https://go-review.googlesource.com/11003 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Alexander Morozov [Wed, 3 Jun 2015 17:50:39 +0000 (10:50 -0700)]
syscall: add GidMappingsEnableSetgroups to Linux SysProcAttr
Linux 3.19 made a change in the handling of setgroups and the 'gid_map' file to
address a security issue.
The upshot of the 3.19 changes is that in order to update the 'gid_maps' file,
use of the setgroups() system call in this user namespace must first be disabled
by writing "deny" to one of the /proc/PID/setgroups files for this namespace.
Also added tests for remapping uid_map and gid_map inside new user
namespace.
Fixes #10626
Change-Id: I4d2539acbab741a37092d277e10f31fc39a8feb7
Reviewed-on: https://go-review.googlesource.com/10670
Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Rob Pike [Fri, 5 Jun 2015 21:23:54 +0000 (14:23 -0700)]
fmt: require newlines to match when scanning with a format
The documentation says that newlines behave like this:
Scan etc.: newlines are spaces.
Scanln etc.: newlines terminate the scan.
Scanf etc.: newlines must match in input and format.
The code did not implement this behavior in all cases,
especially for Scanf. Make it behave:
- Fix the handling of spaces and newlines in ss.Advance.
The code is longer but now behaves as it should.
- Delete the reuse of the current ss in newScanState.
There is really no need, since it's only used in recursive
calls to Scan etc., and the flags are likely wrong. Simpler
just to allocate a new one every time, and likelier to
be correct.
Fixes #10862.
Change-Id: If060ac021017346723b0d62de4e5a305da898f68
Reviewed-on: https://go-review.googlesource.com/10991 Reviewed-by: Andrew Gerrand <adg@golang.org>
Alexandre Cesaro [Fri, 12 Jun 2015 10:16:07 +0000 (12:16 +0200)]
cmd/go: fix documentation
The command "go tool pprof help" does not work:
$ go tool pprof help
open help: no such file or directory
The right command is "go tool pprof -h".
Change-Id: Icef5d4ab76774905854e46665ac1166d26d35f46
Reviewed-on: https://go-review.googlesource.com/10970 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Alex Brainman [Tue, 2 Jun 2015 03:46:28 +0000 (13:46 +1000)]
cmd/dist: convert testso test into Go
I would like to re-apply reverted http://golang.org/cl/8523.
Reverted tests still fail in some environments (see issue #10360).
It is easier to run tests selectively when in Go.
This CL prepares for the changes.
Alex Brainman [Thu, 11 Jun 2015 02:20:42 +0000 (12:20 +1000)]
cmd/go: clean up after 'go build' even on windows
This CL makes CL 10682 work on windows.
Fixes #9645 (again)
Change-Id: Ie9b9af8b041c483a236b46adad4a50aa6e598c92
Reviewed-on: https://go-review.googlesource.com/10930 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Robert Griesemer [Thu, 11 Jun 2015 20:21:46 +0000 (13:21 -0700)]
spec: clarify meaning of x op= y
Suggested by mdempsky (see also issue #11161).
Change-Id: I1ab28febe19b7a092029499015073ce8749b4d99
Reviewed-on: https://go-review.googlesource.com/10960 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Ian Lance Taylor [Wed, 10 Jun 2015 21:40:47 +0000 (14:40 -0700)]
cmd/go: add some parallelism to the testsuite
As these tests were originally in bash, they are not designed to be
particularly hermetic. This CL adds various protective mechanisms to
try to catch cases where the tests can not run in parallel.
Change-Id: I983bf7b6ffba04eda58b4939eb89b0bdfcda8eff
Reviewed-on: https://go-review.googlesource.com/10911 Reviewed-by: Andrew Gerrand <adg@golang.org>
Patrick Mezard [Sun, 10 May 2015 13:35:52 +0000 (15:35 +0200)]
os: fix a race between Process.signal() and wait() on Windows
Process.handle was accessed without synchronization while wait() and
signal() could be called concurrently.
A first solution was to add a Mutex in Process but it was probably too
invasive given Process.handle is only used on Windows.
This version uses atomic operations to read the handle value. There is
still a race between isDone() and the value of the handle, but it only
leads to slightly incorrect error codes. The caller may get a:
errors.New("os: process already finished")
instead of:
syscall.EINVAL
which sounds harmless.
Fixes #9382
Change-Id: Iefcc687a1166d5961c8f27154647b9b15a0f748a
Reviewed-on: https://go-review.googlesource.com/9904 Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Alex Brainman [Tue, 9 Jun 2015 06:16:42 +0000 (16:16 +1000)]
cmd/link: stop linker crashing with -s flag on windows
Update #10254
Change-Id: I3ddd26607813ca629e3ab62abf87dc5ab453e36f
Reviewed-on: https://go-review.googlesource.com/10835 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Carl Jackson [Fri, 17 Apr 2015 07:52:40 +0000 (00:52 -0700)]
crypto/cipher: Support unusual GCM nonce lengths
GCM is traditionally used with a 96-bit nonce, but the standard allows
for nonces of any size. Non-standard nonce sizes are required in some
protocols, so add support for them in crypto/cipher's GCM
implementation.
Change-Id: I7feca7e903eeba557dcce370412b6ffabf1207ab
Reviewed-on: https://go-review.googlesource.com/8946 Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
Dmitry Savintsev [Tue, 9 Jun 2015 10:01:38 +0000 (12:01 +0200)]
doc: updated language about the AUTHORS/CONTRIBUTORS update
Reflect the process changes where AUTHORS and CONTRIBUTORS
files are updated automatically based on commit logs
and Google committers no longer need to do it manually
on the first contributors.
The documentation update will help to avoid requests to be
added from new contributors.
Change-Id: I67daae5bd21246cf79fe3724838889b929bc5e66
Reviewed-on: https://go-review.googlesource.com/10824 Reviewed-by: Rob Pike <r@golang.org>
Adam Langley [Mon, 8 Jun 2015 21:24:18 +0000 (14:24 -0700)]
crypto/tls: don't require an explicit client-auth EKU.
Previously we enforced both that the extended key usages of a client
certificate chain allowed for client authentication, and that the
client-auth EKU was in the leaf certificate.
This change removes the latter requirement. It's still the case that the
chain must be compatible with the client-auth EKU (i.e. that a parent
certificate isn't limited to another usage, like S/MIME), but we'll now
accept a leaf certificate with no EKUs for client-auth.
While it would be nice if all client certificates were explicit in their
intended purpose, I no longer feel that this battle is worthwhile.
Fixes #11087.
Change-Id: I777e695101cbeba069b730163533e2977f4dc1fc
Reviewed-on: https://go-review.googlesource.com/10806 Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
Shenghou Ma [Fri, 5 Jun 2015 19:13:57 +0000 (15:13 -0400)]
go/build: add big endian variant of arm and arm64 to goarch list
Change-Id: Icda8475a7879d49e3b8b873303eb0bed5dd5a238
Reviewed-on: https://go-review.googlesource.com/10792 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Mikio Hara [Tue, 9 Jun 2015 03:10:10 +0000 (12:10 +0900)]
net: disable dualstack listener tests on dragonfly
Change-Id: Ia7914156e4369113dea7c17b3aa51096e25f1901
Reviewed-on: https://go-review.googlesource.com/10834 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Hyang-Ah (Hana) Kim [Mon, 8 Jun 2015 21:22:17 +0000 (14:22 -0700)]
cmd/link/internal/ld: include table of contents of c-archive output.
Change-Id: If11621985c0a5a1f2133cdc974f37fd944b93e5e
Reviewed-on: https://go-review.googlesource.com/10808
Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
The documentation for quick.Value says that it "returns an arbitrary
value of the given type." In spite of this, nil values for pointers were
never generated, which seems more like an oversight than an intentional
choice.
The lack of nil values meant that testing recursive type like
type Node struct {
Next *Node
}
with testing/quick would lead to a stack overflow since the data
structure would never terminate.
This change may break tests that don't check for nil with pointers
returned from quick.Value. Two such instances were found in the standard
library, one of which was in the testing/quick package itself.
Fixes #8818.
Change-Id: Id390dcce649d12fbbaa801ce6f58f5defed77e60
Reviewed-on: https://go-review.googlesource.com/10821 Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
Austin Clements [Mon, 8 Jun 2015 00:13:21 +0000 (20:13 -0400)]
runtime: fix write-barrier-enabled phase list in gcmarkwb_m
Commit 1303957 was supposed to enable write barriers during the
concurrent scan phase, but it only enabled *calls* to the write
barrier during this phase. It failed to update the redundant list of
write-barrier-enabled phases in gcmarkwb_m, so it still wasn't greying
objects during the scan phase.
This commit fixes this by replacing the redundant list of phases in
gcmarkwb_m with simply checking writeBarrierEnabled. This is almost
certainly redundant with checks already done in callers, but the last
time we tried to remove these redundant checks everything got much
slower, so I'm leaving it alone for now.
Austin Clements [Fri, 5 Jun 2015 18:49:27 +0000 (14:49 -0400)]
runtime: unwind stack barriers when writing above the current frame
Stack barriers assume that writes through pointers to frames above the
current frame will get write barriers, and hence these frames do not
need to be re-scanned to pick up these changes. For normal writes,
this is true. However, there are places in the runtime that use
typedmemmove to potentially write through pointers to higher frames
(such as mapassign1). Currently, typedmemmove does not execute write
barriers if the destination is on the stack. If there's a stack
barrier between the current frame and the frame being modified with
typedmemmove, and the stack barrier is not otherwise hit, it's
possible that the garbage collector will never see the updated pointer
and incorrectly reclaim the object.
Fix this by making heapBitsBulkBarrier (which lies behind typedmemmove
and its variants) detect when the destination is in the stack and
unwind stack barriers up to the point, forcing mark termination to
later rescan the effected frame and collect these pointers.
Fixes #11084. Might be related to #10240, #10541, #10941, #11023,
#11027 and possibly others.
Austin Clements [Fri, 5 Jun 2015 21:18:15 +0000 (17:18 -0400)]
runtime: enable write barriers during concurrent scan
Currently, write barriers are only enabled after completion of the
concurrent scan phase, as we enter the concurrent mark phase. However,
stack barriers are installed during the scan phase and assume that
write barriers will track changes to frames above the stack
barriers. Since write barriers aren't enabled until after stack
barriers are installed, we may miss modifications to the stack that
happen after installing the stack barriers and before enabling write
barriers.
Fix this by enabling write barriers during the scan phase.
This commit intentionally makes the minimal change to do this (there's
only one line of code change; the rest are comment changes). At the
very least, we should consider eliminating the ragged barrier that's
intended to synchronize the enabling of write barriers, but now just
wastes time. I've included a large comment about extensions and
alternative designs.
Austin Clements [Fri, 5 Jun 2015 21:36:00 +0000 (17:36 -0400)]
runtime: fix checkmarks to rescan stacks
Currently checkmarks mode fails to rescan stacks because it sees the
leftover state bits indicating that the stacks haven't changed since
the last scan. As a result, it won't detect lost marks caused by
failing to scan stacks correctly during regular garbage collection.
Fix this by marking all stacks dirty before performing the checkmark
phase.
Austin Clements [Wed, 3 Jun 2015 18:59:27 +0000 (14:59 -0400)]
all: use RET instead of RETURN on ppc64
All of the architectures except ppc64 have only "RET" for the return
mnemonic. ppc64 used to have only "RETURN", but commit cf06ea6
introduced RET as a synonym for RETURN to make ppc64 consistent with
the other architectures. However, that commit was never followed up to
make the code itself consistent by eliminating uses of RETURN.
This commit replaces all uses of RETURN in the ppc64 assembly with
RET.
This was done with
sed -i 's/\<RETURN\>/RET/' **/*_ppc64x.s
plus one manual change to syscall/asm.s.
Change-Id: I3f6c8d2be157df8841d48de988ee43f3e3087995
Reviewed-on: https://go-review.googlesource.com/10672 Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Minux Ma <minux@golang.org>
Austin Clements [Fri, 5 Jun 2015 15:07:21 +0000 (11:07 -0400)]
runtime: use correct SP when installing stack barriers
Currently the stack barriers are installed at the next frame boundary
after gp.sched.sp + 1024*2^n for n=0,1,2,... However, when a G is in a
system call, we set gp.sched.sp to 0, which causes stack barriers to
be installed at *every* frame. This easily overflows the slice we've
reserved for storing the stack barrier information, and causes a
"slice bounds out of range" panic in gcInstallStackBarrier.
Fix this by using gp.syscallsp instead of gp.sched.sp if it's
non-zero. This is the same logic that gentraceback uses to determine
the current SP.
Brad Fitzpatrick [Fri, 5 Jun 2015 15:11:34 +0000 (08:11 -0700)]
cmd/dist: add more logging details when go list std cmd fails
Change-Id: I12e6990b46ea9c733a5718dc5ca67f1fcd2dec66
Reviewed-on: https://go-review.googlesource.com/10754 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Alexis Imperial-Legrand [Tue, 2 Jun 2015 15:27:43 +0000 (17:27 +0200)]
debug/gosym: avoid calling the shell in test
Change-Id: I95bf62c0f2d77dd67515921e6aefa511cce8d95d
Reviewed-on: https://go-review.googlesource.com/10633 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Aaron Jacobs [Fri, 5 Jun 2015 00:12:34 +0000 (10:12 +1000)]
flag: Describe the ErrorHandling enum values.
ContinueOnError is particularly confusing, because it causes
FlagSet.Parse to return as soon as it sees an error. I gather that the
intent is "continue the program" rather than "continue parsing",
compared to exiting or panicking.
Change-Id: I27370ce1f321ea4debcee5b03faff3532495c71a
Reviewed-on: https://go-review.googlesource.com/10740 Reviewed-by: Rob Pike <r@golang.org>
Russ Cox [Thu, 21 May 2015 18:42:14 +0000 (14:42 -0400)]
cmd/link: delete dead flags
Also fix the interaction between -buildmode and -shared.
It's okay for -shared to change the default build mode,
but it's not okay for it to silently override an explicit -buildmode=exe.
Change-Id: Id40f93d140cddf75b19e262b3ba4856ee09a07ba
Reviewed-on: https://go-review.googlesource.com/10315 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Russ Cox [Thu, 21 May 2015 18:35:02 +0000 (14:35 -0400)]
cmd/link: deprecate -X name value in favor of -X name=value
People invoking the linker directly already have to change their scripts
to use the new "go tool link", so this is a good time to make the -X flag
behave like all other Go flags and take just a single argument.
The old syntax will continue to be accepted (it is rewritten into the new
syntax before flag parsing). Maybe some day we will be able to retire it.
Even if we never retire the old syntax, having the new syntax at least
makes the rewriting much less of a kludge.
Change-Id: I91e8df94f4c22b2186e81d7f1016b8767d777eac
Reviewed-on: https://go-review.googlesource.com/10310 Reviewed-by: Rob Pike <r@golang.org>