Paul E. Murphy [Thu, 24 Mar 2022 17:06:27 +0000 (12:06 -0500)]
crypto/aes: rewrite ppc64le asm-cbc routine
This loads the keys once per call, not once per block. This
has the effect of unrolling the inner loop too. This allows
decryption to scale better with available hardware.
Noteably, encryption serializes crypto ops, thus no
performance improvement is seen, but neither is it reduced.
Care is also taken to explicitly clear keys from registers
as was done implicitly in the prior version.
Also, fix a couple of typos from copying the asm used to
load ESPERM.
Performance delta on POWER9:
name old time/op new time/op delta
AESCBCEncrypt1K 1.10µs ± 0% 1.10µs ± 0% +0.55%
AESCBCDecrypt1K 793ns ± 0% 415ns ± 0% -47.70%
Russ Cox [Fri, 11 Nov 2022 17:36:31 +0000 (12:36 -0500)]
internal/godebug: define more efficient API
We have been expanding our use of GODEBUG for compatibility,
and the current implementation forces a tradeoff between
freshness and efficiency. It parses the environment variable
in full each time it is called, which is expensive. But if clients
cache the result, they won't respond to run-time GODEBUG
changes, as happened with x509sha1 (#56436).
This CL changes the GODEBUG API to provide efficient,
up-to-date results. Instead of a single Get function,
New returns a *godebug.Setting that itself has a Get method.
Clients can save the result of New, which is no more expensive
than errors.New, in a global variable, and then call that
variable's Get method to get the value. Get costs only two
atomic loads in the case where the variable hasn't changed
since the last call.
Unfortunately, these changes do require importing sync
from godebug, which will mean that sync itself will never
be able to use a GODEBUG setting. That doesn't seem like
such a hardship. If it was really necessary, the runtime could
pass a setting to package sync itself at startup, with the
caveat that that setting, like the ones used by runtime itself,
would not respond to run-time GODEBUG changes.
Change-Id: I99a3acfa24fb2a692610af26a5d14bbc62c966ac
Reviewed-on: https://go-review.googlesource.com/c/go/+/449504
Run-TryBot: Russ Cox <rsc@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Alexander Yastrebov [Fri, 11 Nov 2022 23:23:19 +0000 (23:23 +0000)]
archive/zip: don't read directories containing file data
Fixes #54801
Change-Id: I3d03516792975ddb09835b2621c57e12e7cbad35
GitHub-Last-Rev: 4faa7e14dcc48c05d707f1e137d915da24133e14
GitHub-Pull-Request: golang/go#56714
Reviewed-on: https://go-review.googlesource.com/c/go/+/449955
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Joedian Reid <joedian@golang.org>
Robert Griesemer [Thu, 10 Nov 2022 23:28:03 +0000 (15:28 -0800)]
spec: document the new unsafe functions SliceData, String, and StringData
For #53003.
Change-Id: If5d76c7b8dfcbcab919cad9c333c0225fc155859
Reviewed-on: https://go-review.googlesource.com/c/go/+/449537 Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@google.com>
ruinan [Tue, 8 Nov 2022 08:49:53 +0000 (16:49 +0800)]
math/bits: directly calculate quo/rem when hi is zero in Div64
func Div64(hi, lo, y uint64) (quo, rem uint64) {...}
math/bits.Div64 returns the quotient and remainder of (hi, lo) divided
by y. When hi is zero, we can directly return lo/y, lo%y, which can save
a lot of unnecessary calculations.
The performance is measured on arm64 and the changes will only affect
the arch that doesn't have the intrinsic.
Robert Griesemer [Thu, 10 Nov 2022 21:50:33 +0000 (13:50 -0800)]
spec: clarify struct field and array element comparison order
Fixes #8606.
Change-Id: I64b13b2ed61ecae4641264deb47c9f7653a80356
Reviewed-on: https://go-review.googlesource.com/c/go/+/449536 Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Ian Lance Taylor [Fri, 11 Nov 2022 20:42:51 +0000 (12:42 -0800)]
internal/syscall/unix: use runtime.gostring for Gostring
Under the race detector, checkptr flags uses of unsafe.Slice that
result in slices that straddle multiple Go allocations.
Avoid that scenario by calling existing runtime code.
This fixes a failure on the darwin-.*-race builders introduced in
CL 446178.
Change-Id: I6e0fdb37e3c3f38d97939a8799bb4d10f519c5b9
Reviewed-on: https://go-review.googlesource.com/c/go/+/449936 Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Mateusz Poliwczak [Fri, 11 Nov 2022 07:34:15 +0000 (07:34 +0000)]
net: handle correctly the _gateway and _outbound hostnames for nss myhostname
Fixes #56387
Change-Id: If412134344600caefec425699398522399986d4d
GitHub-Last-Rev: f33540ef8f90e9a8c09f3947aba8c01155516d39
GitHub-Pull-Request: golang/go#56388
Reviewed-on: https://go-review.googlesource.com/c/go/+/445075
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
cui fliter [Fri, 11 Nov 2022 02:05:39 +0000 (10:05 +0800)]
all: fix problematic comments
Change-Id: Ib6ea1bd04d9b06542ed2b0f453c718115417c62c
Reviewed-on: https://go-review.googlesource.com/c/go/+/449755 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Keith Randall <khr@google.com>
Cherry Mui [Wed, 9 Nov 2022 15:44:36 +0000 (10:44 -0500)]
runtime: delay incrementing freeindex in malloc
When the GC is scanning some memory (possibly conservatively),
finding a pointer, while concurrently another goroutine is
allocating an object at the same address as the found pointer, the
GC may see the pointer before the object and/or the heap bits are
initialized. This may cause the GC to see bad pointers and
possibly crash.
To prevent this, we make it that the scanner can only see the
object as allocated after the object and the heap bits are
initialized. As the scanner uses the freeindex to determine if an
object is allocated, we delay the increment of freeindex after the
initialization.
As currently in some code path finding the next free index and
updating the free index to a new slot past it is coupled, this
needs a small refactoring. In the new code mspan.nextFreeIndex
return the next free index but not update it (although allocCache
is updated). mallocgc will update it at a later time.
Fixes #54596.
Change-Id: I6dd5ccf743f2d2c46a1ed67c6a8237fe09a71260
Reviewed-on: https://go-review.googlesource.com/c/go/+/427619
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Bryan C. Mills [Thu, 10 Nov 2022 22:00:18 +0000 (17:00 -0500)]
cmd/go/internal/vcweb: fix a data race in the overview handler
I forgot to lock the scriptResult in the overview handler, and
apparently a cmd/go test is incidentally fetching the overview page at
some point during test execution, triggering the race.
This race was caught almost immediately by the new
linux-amd64-longtest-race builder (see
https://build.golang.org/log/85ab78169a6382a73b1a26c89e64138b387da217).
Adjust PGO inlining default parameters to 99% CDF threshold and
2000 budget. Benchmark results (mostly from Sweet) show that this
set of parameters performs reasonably well, with a few percent
speedup at the cost of a few percent binary size increase.
Also rename the debug flags to start with "pgo", to make it clear
that they are related to PGO.
Change-Id: I0749249b1298d1dc55a28993c37b3185f9d7639d
Reviewed-on: https://go-review.googlesource.com/c/go/+/449477
Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Cherry Mui [Thu, 10 Nov 2022 21:10:32 +0000 (16:10 -0500)]
cmd/internal/obj: reduce allocations in object file writing
Some object file writer functions are structured like, having a
local variable, setting fields, then passing it to a Write method
which eventually calls io.Writer.Write. As the Write call is an
interface call it escapes the parameter, which in turn causes the
local variable to be heap allocated. To reduce allocation, use
pre-allocated scratch space instead.
Mateusz Poliwczak [Thu, 10 Nov 2022 18:52:22 +0000 (18:52 +0000)]
net: auto-reload the /etc/nsswitch.conf on unix systems
This change is made to align with the current (recently changed) glibc behaviour, it will allow the hostLookupOrder method to change its decisions on runtime (based on /etc/nsswitch.conf changes).
Fixes #56515
Change-Id: I241d67f053b6d2111eebcd67744adee02829166e
GitHub-Last-Rev: 82842c127474d5d225d2e9b68568387ee6b0ba04
GitHub-Pull-Request: golang/go#56588
Reviewed-on: https://go-review.googlesource.com/c/go/+/448075
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Ian Lance Taylor [Tue, 1 Nov 2022 23:04:50 +0000 (16:04 -0700)]
runtime: retry thread creation on EAGAIN
This copies the logic we use in runtime/cgo, when calling pthread_create,
into runtime proper, when calling newosproc.
We only do this in newosproc, not newosproc0, because in newosproc0 we
need a nosplit function literal, and we need to pass arguments to it through
newosproc, which is a pain. Also newosproc0 is only called at process
startup, when thread creation is less likely to fail anyhow.
Fixes #49438
Change-Id: Ia26813952fdbae8aaad5904c9102269900a07ba9
Reviewed-on: https://go-review.googlesource.com/c/go/+/447175 Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Paul E. Murphy [Thu, 10 Mar 2022 17:51:00 +0000 (11:51 -0600)]
cmd/dist: define GOPPC64_{cpu} for PPC64 targets
This can be used to provide better instruction selection for assembly
implementations without having to implement two variants and dynamic
runtime selections when a newer GOPPC64 value is used.
Change-Id: I4331037d57b128137280aa7904d08d362391f81e
Reviewed-on: https://go-review.googlesource.com/c/go/+/449115
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Russ Cox [Wed, 9 Nov 2022 20:43:54 +0000 (15:43 -0500)]
os/signal/internal/pty: use libc (not cgo) on macOS
This package is only used by tests anyway, but might as well
remove the cgo use on macOS so that it doesn't show up as
a cgo user, as part of our overall strategy to remove cgo use
in the standard library on macOS.
Change-Id: I5a1a39ed56373385f9d43a5e17098035dc1a451a
Reviewed-on: https://go-review.googlesource.com/c/go/+/449315
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Bryan C. Mills [Thu, 10 Nov 2022 17:30:05 +0000 (12:30 -0500)]
cmd/go/internal/load: remove a special case for "unsafe"
We had a special case to zero out the Target field for package
"unsafe", which is not imported from a normal object file.
As of CL 449376 that special case has been folded into go/build's
logic for setting the PkgObj field, so the special case in
cmd/go/internal/load has become redundant.
Ian Lance Taylor [Tue, 1 Nov 2022 19:33:59 +0000 (12:33 -0700)]
runtime: consolidate some low-level error reporting
Use a single writeErrStr function. Avoid using global variables.
Use a single version of some error messages rather than duplicating
the messages in OS-specific files.
Change-Id: If259fbe78faf797f0a21337d14472160ca03efa0
Reviewed-on: https://go-review.googlesource.com/c/go/+/447055
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
database64128 [Thu, 10 Nov 2022 08:20:29 +0000 (08:20 +0000)]
net: unify TCP keepalive behavior
CL 107196 introduced a default TCP keepalive interval for Dialer and TCPListener (used by both ListenConfig and ListenTCP). Leaving DialTCP out was likely an oversight.
DialTCP's documentation says it "acts like Dial". Therefore it's natural to also expect DialTCP to enable TCP keepalive by default.
This commit addresses this disparity by moving the enablement logic down to the newTCPConn function, which is used by both dialer and listener.
Fixes #49345
Change-Id: I99c08b161c468ed0b993d1dbd2bd0d7e803f3826
GitHub-Last-Rev: 5c2f1cb0fbc5e83aa6cdbdf3ed4e23419d9bca65
GitHub-Pull-Request: golang/go#56565
Reviewed-on: https://go-review.googlesource.com/c/go/+/447917
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Marcus Weiner [Wed, 9 Nov 2022 10:37:28 +0000 (10:37 +0000)]
net/http: build error chains in transport that can be unwrapped
In some places of the HTTP transport errors were constructed that
wrapped other errors without providing the ability to call
`errors.Unwrap` on them to get the underlying error.
These places have been fixed to use `%w` when using `fmt.Errorf`
or to implement `Unwrap() error`.
Fixes #56435
Change-Id: Ieed3359281574485c8d0b18298e25e5f1e14555c
GitHub-Last-Rev: 504efbc507a50bd2cf63001511733e232927089f
GitHub-Pull-Request: golang/go#56451
Reviewed-on: https://go-review.googlesource.com/c/go/+/445775 Reviewed-by: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Damien Neil <dneil@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
Filippo Valsorda [Mon, 1 Aug 2022 11:11:55 +0000 (13:11 +0200)]
crypto/internal/edwards25519: replace scalar field with fiat-crypto
This was the last piece of ref10 code, including the infamous "Christmas
tree" in scMulAdd, that approximately all Ed25519 implementations
inherited. Replace the whole scalar field implementation with a
fiat-crypto generated one, like those in crypto/internal/nistec/fiat.
The only complexity is the wide reduction (both for the 64-byte one and
for the clamped input). For that we do a limbed reduction suggested by
Frank Denis.
Some minor housekeeping and test changes from filippo.io/edwards25519
are included, as part of syncing with downstream.
Ignoring the autogenerated file, the diff is
268 insertions(+), 893 deletions(-)
George Tankersley signed the Individual CLA and authorized me to submit
this change on his behalf at the time he contributed it to
filippo.io/edwards25519.
Co-authored-by: George Tankersley <george.tankersley@gmail.com>
Change-Id: I4084b4d3813f36e16b3d8839df75da1b4fd7846b
Reviewed-on: https://go-review.googlesource.com/c/go/+/420454
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org>
Richard Tweed [Thu, 10 Nov 2022 00:04:07 +0000 (00:04 +0000)]
os: document that WriteFile is not atomic
Fixes #56173
Change-Id: I03a3ad769c99c0bdb78b1d757173d630879fd4dd
GitHub-Last-Rev: e3e31fa0b95aba363b13c45f562e3a4c8b31f2cc
GitHub-Pull-Request: golang/go#56282
Reviewed-on: https://go-review.googlesource.com/c/go/+/443495
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Mateusz Poliwczak [Thu, 10 Nov 2022 18:07:57 +0000 (18:07 +0000)]
net: add support for /etc/hosts aliases using go resolver
It adds support for /etc/hosts aliases and fixes the difference between the glibc cgo and the go DNS resolver.
Examples: https://pastebin.com/Fv6UcAVr
Fixes #44741
Change-Id: I98c484fced900731fbad800278b296028a45f044
GitHub-Last-Rev: 3d47e44f11c350df906d0c986e41891dd6e8d929
GitHub-Pull-Request: golang/go#51004
Reviewed-on: https://go-review.googlesource.com/c/go/+/382996
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
Bryan C. Mills [Thu, 10 Nov 2022 15:03:21 +0000 (10:03 -0500)]
go/build: omit PkgObj for packages "unsafe" and "builtin"
Package "builtin" is not a real, importable package; it exists only
for documentation. Package "unsafe" is not compiled into an object
file from its source code; instead, imports of "unsafe" are handled
specially by the compiler.
(In Go 1.19.3, package "unsafe" did not have an install target, while
package "builtin" did but that target was never written.)
Bryan C. Mills [Thu, 10 Nov 2022 14:44:39 +0000 (09:44 -0500)]
go/build: in TestImportDirTarget, only expect an install target when cgo is enabled
As of CL 448803, packages in GOROOT only have install targets when
they have cgo source files. When cgo is not enabled, that condition
is necessarily false, and no install target will exist.
David Chase [Mon, 7 Nov 2022 16:02:08 +0000 (11:02 -0500)]
cmd/compile: add ability to hash-debug on file:line, including inlining
Modified the fmahash gc debug flag to use this, and modified the
test to check for a hash match that includes inlining. Also
made the test non-short to ensure portability.
Note fma.go has been enhanced into an FMA test that requires
two separate FMAs in order to "fail"; if either one is 2-rounding,
then it "passes". (It neither passes nor fails here; its role
is to demonstrate that the FMAs are correctly reported; the
enhanced failure mode was discovered while testing the search
tool.)
Change-Id: I4e328e3654f442d498eac982135420abb59c5434
Reviewed-on: https://go-review.googlesource.com/c/go/+/448358
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: David Chase <drchase@google.com>
Robert Findley [Thu, 10 Nov 2022 16:15:26 +0000 (11:15 -0500)]
internal/types: fix the iota value in error code declarations
The new "InvalidSyntaxTree" node in the error code declaration
inadvertently incremented the value of iota by 1. Fix this by moving it
to its own declaration.
Change-Id: I34b33a8caddbbb9e41f431321ec0e5863dc15055
Reviewed-on: https://go-review.googlesource.com/c/go/+/449475
Run-TryBot: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Keith Randall [Wed, 9 Nov 2022 23:29:09 +0000 (15:29 -0800)]
go/doc: recognize methods on generic types as Funcs
When writing markdown for godoc, we can reference a method M of
a type T as [T.M]. This doesn't currently work for methods on generic
types because the declaration of the type parameter gets in the way.
(You'd have to write [T[P].M] and that doesn't parse, and even if it
did you'd have to spell "P" correctly.)
Get rid of the type parameter when building the list of Funcs so
[T.M] works in godoc if T is generic.
Change-Id: I8ef5264124a944967df3ce20ddd40a2447ff4187
Reviewed-on: https://go-review.googlesource.com/c/go/+/449236 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Ian Lance Taylor [Thu, 10 Nov 2022 04:55:17 +0000 (20:55 -0800)]
os/user: allocate buffers in Go memory, not C memory
Since the first implementation of os/user, it's called C malloc
to allocate memory for buffers. However, the buffers are just
used for temporary storage, and we can just a []byte instead.
To make this work without causing cgo pointer errors, we move
the pwd and grp structs into C stack memory, and just return them.
It's OK to store a Go pointer on the C stack temporarily.
Change-Id: I9f8ffb6e51df1e585276c259fe99359d7835df87
Reviewed-on: https://go-review.googlesource.com/c/go/+/449335
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
cui fliter [Sun, 4 Sep 2022 15:51:20 +0000 (15:51 +0000)]
expvar: convert f to atomic type
For #53821
Change-Id: I2e7c5376e6ca3e3dbb2f92ad771aed62fca8b793
GitHub-Last-Rev: b67ddf81ecec1892871044fbcb143ca4256ebc55
GitHub-Pull-Request: golang/go#54864
Reviewed-on: https://go-review.googlesource.com/c/go/+/428195 Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Russ Cox [Fri, 11 Feb 2022 22:17:54 +0000 (17:17 -0500)]
cmd/go: cache compiler flag info
When you run 'go env' or any command that needs to consider
what the default gcc flags are (such as 'go list net' or
'go list <any package with net as a dependency>'),
the go command runs gcc (or clang) a few times to see what
flags are available.
These runs can be quite expensive on some systems, particularly
Macs that seem to need to occasionally cache something before
gcc/clang can execute quickly.
To fix this, cache the derived information about gcc under a cache
key derived from the size and modification time of the compiler binary.
This is not foolproof, but it should be good enough.
% go install cmd/go
% time go env >/dev/null
0.22 real 0.01 user 0.01 sys
% time go env >/dev/null
0.03 real 0.01 user 0.01 sys
%
Russ Cox [Wed, 9 Nov 2022 13:50:51 +0000 (08:50 -0500)]
cmd/api: point to API docs in all.bash failure
When people add new API and get an all.bash failure,
they often don't know about the API checker at all.
Point to the README in the failure message, to try to
help them find what they need to know.
Change-Id: I6b148ec414d212033b371357a5e8c6ab79bb50a4
Reviewed-on: https://go-review.googlesource.com/c/go/+/449015
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
crypto: allow hash.Hash for OAEP and MGF1 to be specified independently
crypto/rsa assumes RSA OAEP uses the same hash to be used for both the label
and the mask generation function. However, implementations in other languages,
such as Java and Python, allow these parameters to be specified independently.
This change allows the MGF hash to be specified independently for decrypt
operations in order to allow decrypting ciphertexts generated in other
environments.
Fixes: #19974
Change-Id: If453d628f0da354ceb3b52863f30087471670f7b
Reviewed-on: https://go-review.googlesource.com/c/go/+/418874
Auto-Submit: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Andrew Bonventre <andybons@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Constantin Konstantinidis [Sat, 23 Jul 2022 07:11:32 +0000 (09:11 +0200)]
encoding/xml: error when more than one colon in qualified names
Add test.
Fixes #20396
Change-Id: I89e9013eb338f831e1908e390b284794df78fb6b
Reviewed-on: https://go-review.googlesource.com/c/go/+/103875
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Constantin Konstantinidis [Mon, 20 Aug 2018 18:29:30 +0000 (20:29 +0200)]
encoding/xml: disallow empty namespace when prefix is set
Non-regression tests are added.
Fixes #8068
Change-Id: Icb36c910bbf4955743b7aa8382002b2d9246fadc
Reviewed-on: https://go-review.googlesource.com/c/go/+/105636
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Matthew Dempsky [Wed, 31 Aug 2022 17:24:04 +0000 (10:24 -0700)]
unsafe: add docs for SliceData, String, and StringData
Updates #53003.
Change-Id: I076d1eb4bd0580002ad8008f3ca213c5edc951ee
Reviewed-on: https://go-review.googlesource.com/c/go/+/427095
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
This change made IsAbs return true for certain reserved filenames,
but does not consistently detect reserved names. For example,
"./COM1", "//./COM1", and (on some Windows versions) "COM1.txt"
all refer to the COM1 device, but IsAbs detects none of them.
Since NUL is not an absolute path, do not attempt to detect it
or other device paths in IsAbs. See #56217 for more discussion
of IsAbs and device paths.
For #56217.
Change-Id: If4bf81c7e1a2e8842206c7c5268555102140dae8
Reviewed-on: https://go-review.googlesource.com/c/go/+/448898 Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
Damien Neil [Wed, 9 Nov 2022 00:10:47 +0000 (16:10 -0800)]
os: remove special casing of NUL in Windows file operations
Some file operations, notably Stat and Mkdir, special cased their
behavior when operating on a file named "NUL" (case-insensitive).
This check failed to account for the many other names of the NUL
device, as well as other non-NUL device files: "./nul", "//./nul",
"nul.txt" (on some Windows versions), "con", etc.
Remove the special case.
os.Mkdir("NUL") now returns no error. This is consonant with the
operating system's behavior: CreateDirectory("NUL") succeeds, as
does "MKDIR NUL" on the command line.
os.Stat("NUL") now follows the existing path for FILE_TYPE_CHAR devices,
returning a FileInfo which correctly reports the file as being a
character device.
os.Stat and os.File.Stat have common elements of their logic unified.
Damien Neil [Wed, 19 Oct 2022 21:41:03 +0000 (14:41 -0700)]
path/filepath: detect all forms of \\ volume paths on Windows
Previously, the volumeNameLen function checked for UNC paths starting
with two slashes, a non-'.' character, and another slash. This misses
volume names such as "\\.\C:\".
The previous check for volume names rejects paths beginning
with "\\.". This is incorrect, because while these names are not
UNC paths, "\\.\C:\" is a DOS device path prefix indicating the
C: device. It also misses UNC path prefixes in the form
"\\.\UNC\server\share\".
The previous check for UNC paths also rejects any path with an
empty or missing host or share component. This leads to a number
of possibly-incorrect behaviors, such as Clean(`\\a`) returning `\a`.
Converting the semantically-significant `\\` prefix to a single `\`
seems wrong.
Consistently treat paths beginning with two separators as having
a volume prefix.
Update VolumeName to detect DOS device paths (`\\.\` or `\\?\`),
DOS device paths linking to UNC paths (`\\.\UNC\Server\Share`
or `\\?\UNC\Server\Share`), and UNC paths (`\\Server\Share\`).
Damien Neil [Wed, 9 Nov 2022 17:42:04 +0000 (09:42 -0800)]
cmd/go: improve handling of os.DevNull on Windows
The "go test" and "go build" commands have special-case behavior when
passed "-o /dev/null". These checks are case-sensitive and assume that
os.DevNull is an absolute path. Windows filesystems are case-insensitive
and os.DevNull is NUL, which is not an absolute path.
CL 145220 changed filepath.IsAbs to report "NUL" as absolute to work
around this issue; that change is being rolled back and a better fix here
is to compare the value of -o against os.DevNull before attempting to
merge it with a base path. Make that fix.
On Windows, accept any capitilization of "NUL" as the null device.
This change doesn't cover every possible name for the null device, such
as "-o //./NUL", but this test is for efficiency rather than correctness.
Accepting just the most common name is fine.
Michael Matloob [Tue, 8 Nov 2022 22:33:47 +0000 (17:33 -0500)]
cmd/go: decide whether to install .a based on number of CgoFiles
Instead of hardcoding the set of five packages that depend on cgo to
decide whether a package should have an install target, make the
decision based on whether the package has any CgoFiles. This means that
in nocgo configurations, there will be no installed packages, and that
if an GOOS/GOARCH combination doesn't have cgo files we don't
unnecessarily install a .a.
Because the determination of whether a file is a CgoFile is made later
in the Import functions, the choice of whether to add a PkgObj for teh
case there are CgoFiles is moved later. One concern here is that in some
cases, PkgObj may be set differently in the case of the FindOnly mode,
since the determination is moved across the boundary. We might want
to always set PkgObj after the FindOnly boundary for consistency? cmd/go
doesn't seem to use it when calling Import with FindOnly.
Also remove internal/buildinternal/needs_install.go because we will be
checking whether to install based on the number of cgo files and it
might be overkill to make the NeedsInstalledDotA function be the
equivalent of len(input) > 0.
For #47257
Change-Id: I5f7f2137dc99aaeb2e2695c14e0222093a6b2407
Reviewed-on: https://go-review.googlesource.com/c/go/+/448803 Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Michael Matloob <matloob@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
Damien Neil [Wed, 9 Nov 2022 01:07:40 +0000 (17:07 -0800)]
cmd/go/testdata: don't set GOPATH=NUL in test
An upcoming change to the filepath package to make IsAbs("NUL")==false
on Windows will cause this test to fail, since it sets GOPATH=NUL and
GOPATH must be an absolute path.
Set GOPATH to the name of a text file instead. (The intent is that GOPATH
be set to a path that is not writable.)
Michael Matloob [Mon, 7 Nov 2022 19:30:45 +0000 (14:30 -0500)]
internal/fsys: follow root symlink in fsys.Walk
If fsys.Walk is called with a root directory that is a symlink, follow
the symlink when doing the walk. This allows for users setting their
current directory to a symlink to a module.
Damien Neil [Wed, 9 Nov 2022 01:02:49 +0000 (17:02 -0800)]
cmd/go: more informative test failures when GOROOT is stale
If GOROOT is stale, test fail when commands unexpectedly write to GOROOT.
Include an message in the test failure indicating that this is a possible
and expected reason for the failure, and how to fix it.
Russ Cox [Mon, 7 Nov 2022 16:58:45 +0000 (11:58 -0500)]
cmd/go: print test2json start events
Add a new "Action":"start" test2json event to mark the
start of the test binary execution. This adds useful information
to the JSON traces, and it also lets programs watching test
execution see the order in which the tests are being run,
because we arrange for the starts to happen sequentially.
cui fliter [Tue, 8 Nov 2022 03:37:59 +0000 (11:37 +0800)]
all: fix some comments
Change-Id: I163ea3a770f2228f67d4fb1374653566e64b91f7
Reviewed-on: https://go-review.googlesource.com/c/go/+/448575 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
io: correctly process result of sendfile(2) when src returns 0 bytes
Fixes #53658. io.Copy() uses sendfile(2) to avoid allocating extra buffers when src is a file and dst is a TCPConn. However if src returns no bytes current logic treats it as failure and falls back to copying via user space. The following is a benchmark that illustrates the bug.
Change-Id: I703376d53b20e080c6204a73c96867cce16b24cf
GitHub-Last-Rev: 3a50be4f169683bf9caea32892c66619a66ad21a
GitHub-Pull-Request: golang/go#53659
Reviewed-on: https://go-review.googlesource.com/c/go/+/415834
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Constantin Konstantinidis [Sun, 15 Apr 2018 09:26:32 +0000 (11:26 +0200)]
encoding/xml: error when closing tag does not match opening tag
Comparing opening and closing tag is done using the prefix when available.
Documentation states that Token returns URI in the Space part of the Name.
Translation has been moved for the End tag before the namespace is removed
from the stack.
After closing a tag using a namespace, the valid namespace must be taken
from the opening tag. Tests added.
Fixes #20685
Change-Id: I4d90b19f7e21a76663f0ea1c1db6c6bf9fd2a389
Reviewed-on: https://go-review.googlesource.com/c/go/+/107255
Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Constantin Konstantinidis [Thu, 12 Apr 2018 06:55:16 +0000 (08:55 +0200)]
encoding/xml: add check of namespaces to detect field names conflicts
Test added.
Fixes #8535
Change-Id: Ic89c2781e81d963a653180812748b3fc95fb7fae
Reviewed-on: https://go-review.googlesource.com/c/go/+/106575
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
Matthew Horsnell [Tue, 28 Jun 2022 13:25:58 +0000 (14:25 +0100)]
runtime internal/cpu: rename "Zeus" "NeoverseV1".
Rename "Zeus" to "NeoverseV1" for the partnum 0xd40 to be
consistent with the documentation of MIDR_EL1 as described in
https://developer.arm.com/documentation/101427/0101/?lang=en
Change-Id: I2e3d5ec76b953a831cb4ab0438bc1c403648644b
Reviewed-on: https://go-review.googlesource.com/c/go/+/414775 Reviewed-by: Jonathan Swinney <jswinney@amazon.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Eric Fang <eric.fang@arm.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
Russ Cox [Tue, 8 Nov 2022 21:16:44 +0000 (16:16 -0500)]
net: allocate res_state entirely in C memory
The linux-amd64-wsl builder was failing because the res_nsearch
implementation was storing pointer to the res_state's own fields
in other fields in the res_state. If the res_state is Go memory, this
looks like pointers to Go pointers. Moving the res_state to C memory
avoids the problem.
The linux-amd64-wsl builder has been fixed a different way by
replacing res_nsearch with res_search on Linux, where it is thread-safe.
But other systems that still need to use res_nsearch (such as macOS)
may run into the same kind of problem, so it is probably still worth
arranging for the res_state to live entirely in C memory.
Xiangdong Ji [Fri, 25 Jun 2021 13:51:22 +0000 (21:51 +0800)]
runtime: fix uncondition calls to traceGCSTWDone
startTheWorldWithSema should call traceGCSTWDone only when
the tracing is enabled.
Change-Id: Ibc7181834f68af3923e4b2aee01a57492ab6213e
Reviewed-on: https://go-review.googlesource.com/c/go/+/330835 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Jakub Ciolek [Wed, 27 Jul 2022 07:02:17 +0000 (09:02 +0200)]
runtime: remove the started field from sweepdata
This bool doesn't seem to be used anymore. Remove it.
Change-Id: Ic73346a98513c392d89482c5e1d818a90d713516
Reviewed-on: https://go-review.googlesource.com/c/go/+/419654
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Matthew Dempsky [Mon, 17 Oct 2022 23:57:07 +0000 (16:57 -0700)]
cmd/compile: fix transitive inlining of generic functions
If an imported, non-generic function F transitively calls a generic
function G[T], we may need to call CanInline on G[T].
While here, we can also take advantage of the fact that we know G[T]
was already seen and compiled in an imported package, so we don't need
to call InlineCalls or add it to typecheck.Target.Decls. This saves us
from wasting compile time re-creating DUPOK symbols that we know
already exist in the imported package's link objects.
Fixes #56280.
Change-Id: I3336786bee01616ee9f2b18908738e4ca41c8102
Reviewed-on: https://go-review.googlesource.com/c/go/+/443535
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Russ Cox [Tue, 8 Nov 2022 19:21:27 +0000 (14:21 -0500)]
net: fix res_search uses on alpine, android, dragonfly
On Android and Dragonfly, don't use -lresolv. It doesn't exist there.
On Linux, use res_search instead of res_nsearch.
glibc makes res_search thread-safe by having a per-thread __res.
It still also provides res_nsearch.
musl makes res_search thread-safe by ignoring __res completely.
It does not provide res_nsearch at all.
Changing to res_search on Linux will fix builds on musl-based systems
while keeping glibc-based systems working.
Russ Cox [Tue, 8 Nov 2022 19:04:24 +0000 (14:04 -0500)]
net: pass C string to res_nsearch, in case it stores the pointer
The current code passes a Go pointer to a NUL-terminated C string
to the C function res_nsearch (or res_search), but that function may
in turn store the pointer into the res_state, which is a violation of the
cgo pointer rules and is being detected on the linux-amd64-wsl builder.
Allocating the string in C memory is safer and should resolve
the cgo pointer check. When using libc/syscall mode, the memory
is still allocated Go-side, which could potentially be a problem
if we ever add a moving collector. For now it is OK.
qmuntal [Fri, 4 Nov 2022 08:50:09 +0000 (09:50 +0100)]
cmd/go: fix svn vctest on Windows and make them timezone agnostic
This CL updates svn vctest so they work on Windows.
Side effect is that svn logs are no longer timezone dependant, as this
updated the `svn log` command to format logs using XML, which contain
UTC dates instead of local dates. Therefore it supersedes
https://go-review.googlesource.com/c/go/+/447795.
Michael Anthony Knyszek [Thu, 14 Jul 2022 21:26:55 +0000 (21:26 +0000)]
runtime: smooth cons/mark with a moving average and use actual trigger
This change modifies the pacer in two ways:
* It replaces the PI controller used as a smoothing function with a
simple two-cycle moving average.
* It makes the pacer use the actual GC trigger point for cons/mark (and
other) calculations instead of the precomputed one.
The second part of this change was attempted in the Go 1.19 release
cycle, but could not be done because although it resulted in a
better-behaved pacer, it exploited the PI controller's sensitivity to
history in a way that was ultimately unfavorable for most applications.
This sensitivity is complex to reason about, and forces us into choices
that don't really make sense (like using the precomputed trigger over
the actual one -- that's really a bug fix).
The net effect of this change is intended to be:
* The pacer computes a more stable estimate of the actual cons/mark
ratio, making it easier to understand.
* The pacer is much more accurate at hitting the heap goal, so the GC
respects GOGC much more often and reliably.
* The pacer forces a more stable rate of GC assists in the
steady-state overall.
See https://perf.golang.org/search?q=upload:20221106.10 for benchmark
results and #53892 for complete context. The benchmarks that regress
in memory use appear to be not worth worrying about. In all cases, it appears that the GC was triggering super early, resulting in a lack
of adherence to rule of GOGC.
The fogleman benchmarks just have a single final GC that triggers
early and also happens to be the peak heap size. The tile38
WithinCircle benchmark only has 4 GC cycles in the benchmarked region,
so it's very sensitive to pacing. In this case, the old smoothing
function is getting lucky by starting way too early, avoiding assists. Meanwhile the 2-cycle moving average is more accurate on the heap
goal, but the 1st and 2nd cycle after the initialization phase are operating on a cons/mark from the initialization phase which is much
less active, resulting in a cons/mark that's too low, causing the GC
to start too late, increasing assists, and therefore latency (but
only transiently, at this phase change). I really do think the PI
controller is just getting lucky here with a particular history,
because I've definitely observed it oscillating wildly in response to
a phase change.
This change also moves the PI controller out of mgcpacer.go, because
it's no longer used there. It now lives in mgcscavenge.go, where it's
actually used.
Fixes #53892.
Change-Id: I3f875a2e40f31f381920f91d8b090556b17a2b16
Reviewed-on: https://go-review.googlesource.com/c/go/+/417558
Run-TryBot: Michael Knyszek <mknyszek@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Cherry Mui [Mon, 7 Nov 2022 21:46:28 +0000 (16:46 -0500)]
cmd/compile/internal/pgo: allow and ignore profiles with no sample
Passing a profile with no sample is arguably not a user error.
Accept such a profile, and ignore it as it doesn't indicate any
optimizations. This also makes testing easier.
Change-Id: Iae49a4260e20757419643153f50d8d5d51478411
Reviewed-on: https://go-review.googlesource.com/c/go/+/448495
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com>
Russ Cox [Fri, 28 Oct 2022 14:57:14 +0000 (10:57 -0400)]
net: unify CNAME handling across ports
Unix and Windows differ in how they handle LookupCNAME(name).
If name exists in DNS with an A or AAAA record but no CNAME,
then on all operating systems and in the pure Go resolver,
LookupCNAME returns the name associated with the A/AAAA record
(the original name).
TestLookupCNAME has been testing this, because www.google.com
has no CNAME. I think it did at one point, but not anymore, and the
tests are still passing. Also added google.com as a test, since
top-level domains are disallowed from having CNAMEs.
If name exists in DNS with a CNAME record pointing to a record that
does not exist or that has no A or AAAA record,
then Windows has always reported the CNAME value,
but Unix-based systems and the pure Go resolver have reported
a failure instead. cname-to-txt.go4.org is an test record that is
a CNAME to a non-A/AAAA target (the target only has a TXT record).
This CL changes the Unix-based systems and the pure Go resolver
to match the Windows behavior, allowing LookupCNAME to succeed
whenever a CNAME exists.
TestLookupCNAME nows tests the new behavior by looking up
cname-to-txt.go4.org (run by bradfitz).
Russ Cox [Mon, 7 Nov 2022 16:45:57 +0000 (11:45 -0500)]
cmd/go: replace Action.Func with Action.Actor
The interface will let us store actor-specific state in the
interface implementation instead of continuing to grow
the Action struct. In the long term we should remove fields
from the struct that are not used by all Actions.