This function is absolutely critical for clients such as
exp/ssa, and too complex for clients to duplicate.
As with CL 7200046, gri expressed in the doc below [gophers
only] before going on leave that he intended to expose such a
predicate, though his wording suggests as an interface method
of Type rather than a standalone function. (My preference is
for binary methods to be standalone; see "On Binary Methods",
Kim Bruce, 1995). In any case if he wishes to move it that's
easily accommodated by clients.
https://docs.google.com/a/google.com/document/d/1-DQ4fxlMDs9cYtnkKhAAehX6MArjOQyJsRXp-6kiJLA/edit#heading=h.k3bwja7xony9
R=iant, gri, iant
CC=golang-dev
https://golang.org/cl/7203051
On Windows, crypto/x509 passes through to Windows's CryptoAPI
to verify certificate chains. This method can't produce a
SystemRootsError, so make sure we always skip the test on
Windows.
This is needed because testVerify is called in both
TestGoVerify and TestSystemVerify on Windows - one is for
testing the Go verifier, the other one is for testing the
CryptoAPI verifier. The orignal CL tried to sidestep
this issue by setting systemSkip to true, but that only
affected TestSystemVerify.
R=golang-dev, agl, snaury, minux.ma
CC=golang-dev
https://golang.org/cl/7185043
further to how (I believe) it will end up being.
It is nicer to separate search from sorting functionality. Collation needs tables that
are not needed by search and vice-versa. The common functionality is separated out
in the Weigher interface. As this interface is very low-level, it will be moved to
a sub package (colltab) in a next CL.
The types that will move to this package are Weigher, Elem, and Level. The addition
of Elem allows for removing some of the duplicate code between collate and collate/build.
This CL also introduces some stubs for a higher-level API for options. The default
proposed options are quite complex and require the user to have a decent understanding
of Unicode collation. The new options hide a lot of the complexity.
R=rsc
CC=golang-dev
https://golang.org/cl/7058051
Fixes the fork-exec/wait race condition for ForkExec
as well, by making it use startProcess. This makes the
comment for StartProcess consistent as well.
Further, the passing of Waitmsg data in startProcess
and WaitProcess is protected against possible forks
from outside of ForkExec and StartProcess, which might
cause interference with the Await call.
R=rsc, rminnich, npe, ality
CC=golang-dev
https://golang.org/cl/7128059
BenchmarkString before:
11990 ns/op 1621 B/op 73 allocs/op
Using bytes.Buffer:
8774 ns/op 1994 B/op 40 allocs/op
I also tried making a version of escape() that writes directly to the
bytes.Buffer, but it only saved 1 alloc/op and increased CPU time by
about 10%. Didn't seem worth the extra code path.
R=bradfitz
CC=golang-dev
https://golang.org/cl/7182050
Parse("file:///foo") previously returned a URL with Scheme "file"
and Path "///foo". Now it returns a URL with Path "/foo",
such that
&URL{Scheme: "file", Path: "/foo"}.String() == "file:///foo"
This means that parsing and stringifying the URL "file:/foo"
returns "file:///foo", technically a regression but one that only
affects a corner case.
Fixes#4189.
R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/7135051
This proposal adds two methods to *testing.T, Skip(string) and Skipf(format, args...). The intent is to replace the existing log and return idiom which currently has 97 cases in the standard library. A simple example of Skip would be:
func TestSomethingLong(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode.")
// not reached
}
... time consuming work
}
Additionally tests can be skipped anywhere a *testing.T is present. An example adapted from the go.crypto/ssh/test package would be:
// setup performs some before test action and returns a func()
// which should be defered by the caller for cleanup.
func setup(t *testing.T) func() {
...
cmd := exec.Command("sshd", "-f", configfile, "-i")
if err := cmd.Run(); err != nil {
t.Skipf("could not execute mock ssh server: %v", err)
}
...
return func() {
// stop subprocess and cleanup
}
}
func TestDialMockServer(t *testing.T) {
cleanup := setup(t)
defer cleanup()
...
}
In verbose mode tests that are skipped are now reported as a SKIP, rather than PASS.
Link to discussion: https://groups.google.com/d/topic/golang-nuts/BqorNARzt4U/discussion
R=adg, rsc, r, n13m3y3r
CC=golang-dev, minux.ma
https://golang.org/cl/6501094
Go 1.0 behavior was to create an UnmarshalFieldError when a json value name matched an unexported field name. This error will no longer be created and the field will be skipped instead.
Fixes#4660.
R=adg, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/7139049
It wasn't removing names from func parameters for func types,
and it was handling "a, b string" as "string", not "string, string".
Fixes#4688
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7181051
The Plan 9 compilers complain about not
having type information for the function,
which sets off type signature problems
during the linking stage.
R=rsc, ality, iant
CC=golang-dev
https://golang.org/cl/7058054
Before:
$ go list -f '{{range .Deps}}{{println $.Name .}}{{end}}' math time
math runtime
math unsafe
time errors
time runtime
time sync
time sync/atomic
time syscall
time unsafe
$
After:
$ go list -f '{{range .Deps}}{{println $.Name .}}{{end}}' math time
math runtime
math unsafe
time errors
time runtime
time sync
time sync/atomic
time syscall
time unsafe
$
R=minux.ma, rsc
CC=golang-dev
https://golang.org/cl/7130052
All packages place testdata in a specific directory with the name
"testdata". The mime and strconv packages have been updated to use
the same convention.
mime: Move "mime/test.types" to "mime/testdata/test.types". Update test
code accordingly.
strconv: Move "strconv/testfp.txt" to "strconv/testdata/testfp.txt".
Update test code accordingly.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7098072
This fixes the incorrect unix timestamp of the standard time and adds
an example for (Time) Format to clarify how timezones work in format strings.
Fixes#4364.
R=golang-dev, remyoudompheng, kevlar, rsc
CC=golang-dev
https://golang.org/cl/7069046
Offsets for return values from seek were miscalculated
and a translation from 32-bit code for error handling
was incorrect.
R=rsc, rminnich, npe
CC=golang-dev
https://golang.org/cl/7181045
Previously, Go TLS servers always took the client's preferences into
account when selecting a ciphersuite. This change adds the option of
using the server's preferences, which can be expressed by setting
tls.Config.CipherSuites.
This mirrors Apache's SSLHonorCipherOrder directive.
R=golang-dev, nightlyone, bradfitz, ality
CC=golang-dev
https://golang.org/cl/7163043
Currently it's summed to mark phase.
The change makes it easier to diagnose long stop-the-world phases.
R=golang-dev, bradfitz, dave
CC=golang-dev
https://golang.org/cl/7182043
1. note that to use C.free <stdlib.h> must be included
2. can also extract errno from a void C function
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6935045
sizeof(Adr) from 24 bytes down to 20 bytes.
sizeof(Prog) from 84 bytes down to 76 bytes.
5l linking cmd/godoc statistics:
Before:
Maximum resident set size (kbytes): 106668
After:
Maximum resident set size (kbytes): 99412
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/7100059
so that the user don't need to decipher something like this:
template: main:1: expected %!s(parse.itemType=14) in end; got "|"
now they get this:
template: main:1: unexpected "|" in end
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7128054
I messed this up from the beginning. The receiver isn't a pointer so
setting Err is useless. In order to maintain the API, just remove the
superfluous code.
Fixes#4657.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7161043
Prog
* Remove the unused Prog* dlink
* note that align is also unused, but removing it does not help due to alignment issues.
Saves 4 bytes, sizeof(Prog): 84 => 80.
Sym
* Align {u,}char fields on word boundaries
Saves 4 bytes, sizeof(Sym): 136 => 132.
Tested on linux/arm and freebsd/arm.
R=minux.ma, remyoudompheng, rsc
CC=golang-dev
https://golang.org/cl/7106050
Fortunately we have never seen the panic on sockaddrToTCP
in the past year.
««« original CL description
net: panic if sockaddrToTCP returns nil incorrectly
Part of diagnosing the selfConnect bug
TBR=dsymonds
R=golang-dev
CC=golang-dev
https://golang.org/cl/5687057
»»»
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7137063
cmd/8g/gsubr.c: unreachable code
cmd/8g/reg.c: overspecifed class
cmd/dist/plan9.c: unused parameter
cmd/gc/fmt.c: stkdelta is now a vlong
cmd/gc/racewalk.c: used but not set
R=golang-dev, seed, rsc
CC=golang-dev
https://golang.org/cl/7067052
The FmtLong flag should only be used with the %D verb
when printing an ATEXT Prog. It was erroneously used
for every Prog except ADATA. This caused a preponderance
of exclamation points, "!!", in the assembly listings.
I also cleaned up the code so that the list.c files look
very similar. Now the real differences are easily spotted
with a simple diff.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7128045