1
0
mirror of https://github.com/golang/go synced 2024-11-06 13:36:12 -07:00
Commit Graph

30629 Commits

Author SHA1 Message Date
Mikio Hara
fd0f69c680 net: use testenv.SkipFlaky instead of testing.Skip
Change-Id: Ic219fedbe6bbb846f31111fa21df6f2b8620e269
Reviewed-on: https://go-review.googlesource.com/33263
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-17 16:27:35 +00:00
Brad Fitzpatrick
7534a72ea8 fmt: fix typo
Fixes #17955

Change-Id: Ia1a04796353c83358a38a6b63f2a0cd3c6926f09
Reviewed-on: https://go-review.googlesource.com/33338
Reviewed-by: Rob Pike <r@golang.org>
2016-11-17 15:29:40 +00:00
Alex Brainman
03ca047dd3 debug/pe: do not create symbol table if FileHeader.PointerToSymbolTable is 0
https://github.com/tpn/pdfs/raw/master/Microsoft Portable Executable and Common Object File Format Specification - 1999 (pecoff).doc
says this about PointerToSymbolTable:

File offset of the COFF symbol table or 0 if none is present.

Do as it says.

Fixes #17809.

Change-Id: Ib1ad83532f36a3e56c7e058dc9b2acfbf60c4e72
Reviewed-on: https://go-review.googlesource.com/33170
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-17 07:55:06 +00:00
Alex Brainman
dadfd14bab os: add more tests in TestReadStdin
TestReadStdin always fill up buffer provided by ReadFile caller full.
But we do not know if real ReadFile does the same. Add tests where
buffer is only filled with limited data.

Change-Id: I0fc776325c2b1fe60511126c439f4b0560e9d653
Reviewed-on: https://go-review.googlesource.com/33030
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-17 07:03:49 +00:00
Mikio Hara
b8d56fdd93 net: tweak comment on ExampleCIDRMask
CIDRMask just returns a mask which corresponds to an address
prefix in CIDR nonation. A subnet for an IPv6 mask sounds a bit
confusing.

Change-Id: Ic7859ce992bc2de4043d3b25caf9a1051d118b0e
Reviewed-on: https://go-review.googlesource.com/33262
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-11-17 06:43:33 +00:00
Lynn Boger
b2d34fa51b runtime: handle bad ftab index in symtab.go
If a program has had its text section split into multiple
sections then the ftab that is built is based on addresses
prior to splitting.  That means all the function addresses
are there and correct because of relocation but the
but the computed idx won't always match up quite right and
in some cases go beyond the end of the table, causing a panic.

To resolve this, determine if the idx is too large and if it is,
set it to the last index in ftab.  Then search backward to find the
matching function address.

Fixes #17854

Change-Id: I6940e76a5238727b0a9ac23dc80000996db2579a
Reviewed-on: https://go-review.googlesource.com/32972
Reviewed-by: David Chase <drchase@google.com>
2016-11-17 04:36:53 +00:00
Joonas Kuorilehto
a1235f3179 crypto/tls: add example for Config KeyLogWriter
For #13057.

Change-Id: Idbc50d5b08e055a23ab7cc9eb62dbc47b65b1815
Reviewed-on: https://go-review.googlesource.com/29050
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-17 03:24:31 +00:00
Ian Lance Taylor
011cb64231 cmd/compile, reflect: use field pkgPath if needed
It's possible for the pkgPath of a field to be different than that of
the struct type as a whole. In that case, store the field's pkgPath in
the name field. Use the field's pkgPath when setting PkgPath and when
checking for type identity.

Fixes #17952.

Change-Id: Iebaf92f0054b11427c8f6e4158c3bebcfff06f45
Reviewed-on: https://go-review.googlesource.com/33333
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-11-17 01:19:46 +00:00
Ian Lance Taylor
fbf92436b9 doc: add FAQ: why no conversion from []T1 to []T2?
Fixes #16934.

Change-Id: I725704e4c4aae7023fd89edc42af7ba0d242fec8
Reviewed-on: https://go-review.googlesource.com/33327
Reviewed-by: Rob Pike <r@golang.org>
2016-11-17 00:18:12 +00:00
Brad Fitzpatrick
48858a2386 net/http: deflake TestInterruptWithPanic_nil_h2, again
Updates #17243

Change-Id: Iaa737874e75fdac73452f1fc13a5749e8df78ebe
Reviewed-on: https://go-review.googlesource.com/33332
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-17 00:15:36 +00:00
Daniel Martí
14e9f4825b cmd/cover: don't ignore os.Create error
Failing to create the output file would give confusing errors such as:

	cover: invalid argument

Also do out.Close() even if Execute() errored.

Fixes #17951.

Change-Id: I897e1d31f7996871c54fde7cb09614cafbf6c3fc
Reviewed-on: https://go-review.googlesource.com/33278
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
2016-11-17 00:10:10 +00:00
Scott Bell
d7c0de98a9 database/sql: additional underlying types in DefaultValueConverter
The previous documentation purported to convert underlying strings to
[]byte, which it did not do. This adds support for underlying bool,
string, and []byte, which convert directly to their underlying type.

Fixes #15174.

Change-Id: I7fc4e2520577f097a48f39c9ff6c8160fdfb7be4
Reviewed-on: https://go-review.googlesource.com/27812
Reviewed-by: Daniel Theophanes <kardianos@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
2016-11-17 00:09:27 +00:00
Kevin Burke
0df762ed7b net: add example for CIDRMask
I had trouble translating the documentation language into a subnet
- e.g. whether /31 was CIDRMask(1, 31) or CIDRMask(1, 32) or
CIDRMask(31, 32) so I thought I'd add a short example showing how to
create the right masks.

Change-Id: Ia6a6de08c5c30b6d2249b3194cced2d3c383e317
Reviewed-on: https://go-review.googlesource.com/32677
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-16 23:25:51 +00:00
Ian Lance Taylor
fe057c1478 runtime/cgo: fixes for calling sigaction in C
Zero out the sigaction structs, in case the sa_restorer field is set.

Clear the SA_RESTORER flag; it is part of the kernel interface, not the
libc interface.

Fixes #17947.

Change-Id: I610348ce3c196d3761cf2170f06c24ecc3507cf7
Reviewed-on: https://go-review.googlesource.com/33331
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
2016-11-16 23:10:33 +00:00
Brad Fitzpatrick
8dc47e3b3a net: disable TestAcceptTimeout for now
It's too flaky and doing more harm than good.

Disable it until it can be made reliable.

Updates #17948
Updates #17927

Change-Id: Iaab7f09a4060da377fcd3ca2262527fef50c558d
Reviewed-on: https://go-review.googlesource.com/33330
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-16 22:30:19 +00:00
Daniel Theophanes
49b77a8797 database/sql: guard against driver.Stmt.Close panics
Do not retain a lock when driver.Stmt.Close panic as the rest
of the sql package ensures.

Updates #16019

Change-Id: Idc7ea9258ae23f491e79cce3efc365684a708428
Reviewed-on: https://go-review.googlesource.com/33328
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-16 22:21:02 +00:00
Mikio Hara
81627f0e47 net: deflake TestAcceptTimeout again
This is a followup to CL 33257.

It looks like active close operation at passive open side sometimes
takes a bit long time on Darwin.

Fixes #17948.

Change-Id: Ida17639c4e66a43e1be1f74fd0ef3baddde25092
Reviewed-on: https://go-review.googlesource.com/33258
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-11-16 22:09:39 +00:00
David Chase
9f5673d930 cmd/compile: ensure necessary types appear in .debug_info
Autotmp filtering was too aggressive and excluded types
necessary to make debuggers work properly.  Restore the
"late filter" in dwarf.go based on names to exclude autotmps,
and remove the "early filter" in pgen.go based on how the
name was introduced.  However, the updated naming scheme
with a dot prefix is retained to prevent accidental clashes
with legal Go identifier names.

Includes test (grouped with runtime gdb tests),
verified to fail without the fix.

Updates #17644.
Fixes #17830.

Change-Id: I7ec3f7230083889660236e5f6bc77ba5fe434e93
Reviewed-on: https://go-review.googlesource.com/33233
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2016-11-16 22:05:19 +00:00
Cherry Zhang
1e3c57c2cc cmd/internal/obj/arm64: fix branch too far for CBZ (and like)
The assembler backend fixes too-far conditional branches, but only
for BEQ and like. Add a case for CBZ and like.

Fixes #17925.

Change-Id: Ie516e6c5ca165b582367283a0110f7081e00c214
Reviewed-on: https://go-review.googlesource.com/33304
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
2016-11-16 20:31:40 +00:00
Brad Fitzpatrick
cd66c38619 runtime/pprof: skip profiling tests on mips if highres timers not available
Fixes #17936

Change-Id: I20d09712b7d7303257994356904052ba64bc5bf2
Reviewed-on: https://go-review.googlesource.com/33306
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-11-16 20:07:47 +00:00
Mikio Hara
e279280d0d net: deflake TestAcceptTimeout
This change makes use of synchronization primitive instead of
context-based canceling not to depend on defer execution scheduling.

Fixes #17927.

Change-Id: I5ca9287a48bb5cdda6845a7f12757f95175c5db8
Reviewed-on: https://go-review.googlesource.com/33257
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-11-16 19:51:55 +00:00
Brad Fitzpatrick
d8b14c5243 math/rand: make floating point tests shorter on mips and mipsle
Like GOARM=5 does.

Fixes #17944

Change-Id: Ica2a54a90fbd4a29471d1c6009ace2fcc5e82a73
Reviewed-on: https://go-review.googlesource.com/33326
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2016-11-16 19:22:53 +00:00
Daniel Martí
68fda1888e all: call flag.Parse from TestMain only if used
These don't use any flags in TestMain itself, so the call is redundant
as M.Run will do it.

Change-Id: I00f2ac7f846dc2c3ad3535eb8177616b2d900149
Reviewed-on: https://go-review.googlesource.com/33275
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-16 19:01:01 +00:00
David Crawshaw
7ee7936523 cmd/link: handle R_GOTPCREL separately on darwin
To generate the correct section offset the shared code path for
R_CALL, R_PCREL, and R_GOTPCREL on darwin when externally linking
walks up the symbol heirarchy adding the differences. This is fine,
except in the case where we are generating a GOT lookup, because
the topmost symbol is left in r.Xsym instead of the symbol we are
looking up. So all funcsym GOT lookups were looking up the outer
"go.func.*" symbol.

Fix this by separating out the R_GOTPCREL code path.

For #17828 (and may fix it).

Change-Id: I2c9f4d135e77c17270aa064d8c876dc6d485d659
Reviewed-on: https://go-review.googlesource.com/33211
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-11-16 18:37:03 +00:00
Ian Lance Taylor
b75b9e1d65 database/sql: clarify when statement in transaction is closed
Fixes #16346.

Change-Id: Ie75a4ae7011036dd2c1f121a7a5e38d10177721e
Reviewed-on: https://go-review.googlesource.com/33296
Reviewed-by: Daniel Theophanes <kardianos@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-16 16:04:18 +00:00
Daniel Martí
26069e1981 cmd/compile: remove some unused code
The use of these has been removed in recent commits.

Change-Id: Iff36a3ee4dcdfe39c40e93e2601f44d3c59f7024
Reviewed-on: https://go-review.googlesource.com/33274
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-16 16:00:35 +00:00
Mikio Hara
d338f2e147 net: don't run TestTCPBig unconditionally
The test requires tons of memory and results various failures, mainly
runtime errors and process termination by SIGKILL, caused by resource
exhaustion when the node under test doesn't have much resources.

This change makes use of -tcpbig flag to enable the test.

Change-Id: Id53fa5d88543e2e60ca9bb4f55a1914ccca844e1
Reviewed-on: https://go-review.googlesource.com/33254
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-16 05:51:18 +00:00
Bryan C. Mills
1f605175b0 runtime/cgo: use libc for sigaction syscalls when possible
This ensures that runtime's signal handlers pass through the TSAN and
MSAN libc interceptors and subsequent calls to the intercepted
sigaction function from C will correctly see them.

Fixes #17753.

Change-Id: I9798bb50291a4b8fa20caa39c02a4465ec40bb8d
Reviewed-on: https://go-review.googlesource.com/33142
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-16 05:38:38 +00:00
Mikio Hara
c69233be84 net/http: fix a typo in test
Change-Id: I897237667ffe9e9b2a5f92251a6f665d29479fd2
Reviewed-on: https://go-review.googlesource.com/33255
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-11-16 05:35:16 +00:00
Ian Lance Taylor
b906df653b os/exec: add closeOnce.WriteString method
Add an explicit WriteString method to closeOnce that acquires the
writers lock.  This overrides the one promoted from the
embedded *os.File field.  The promoted one naturally does not acquire
the lock, and can therefore race with the Close method.

Fixes #17647.

Change-Id: I3460f2a0d503449481cfb2fd4628b4855ab0ecdf
Reviewed-on: https://go-review.googlesource.com/33298
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-16 02:24:30 +00:00
Brad Fitzpatrick
1b66b38e25 api, doc: update go1.8.txt and next.txt
Both automated updates with a few tweaks.

Change-Id: I24579a8dcc32a84a4fff5c2212681ef30dda61d1
Reviewed-on: https://go-review.googlesource.com/33297
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-16 01:19:56 +00:00
Vladimir Stefanovic
272032d0b2 runtime: add support files for linux/mips{,le} port
Only exe buildmode without cgo supported.

Change-Id: Id104a79a99d3285c04db00fd98b8affa94ea3c37
Reviewed-on: https://go-review.googlesource.com/31487
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2016-11-15 21:49:01 +00:00
Ian Lance Taylor
4d1fdd8b5e test: add test case that failed when built with gccgo
Change-Id: Ie7512cc27436cde53b58686b32a0389849a365e4
Reviewed-on: https://go-review.googlesource.com/33249
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-15 21:25:44 +00:00
David du Colombier
816aa99b9a syscall: define bind flags on Plan 9
These bind flags were removed by mistake in CL 2167.

Fixes #17921.

Change-Id: I1e8089dade30a212b8db0b216c8299946d924d4b
Reviewed-on: https://go-review.googlesource.com/33271
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-15 18:19:10 +00:00
Ian Lance Taylor
59dc9d7a89 cmd/cgo: add missing period in comment
Change-Id: I05f31938f3736100bd8b20a150c9fe3a6ffcdeae
Reviewed-on: https://go-review.googlesource.com/33245
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-15 17:42:30 +00:00
Ian Lance Taylor
27b68474ca cmd/cgo: run cgo pointer checks for pointer to union
If a C union type (or a C++ class type) can contain a pointer field,
then run the cgo checks on pointers to that type. This will test the
pointer as though it were an unsafe.Pointer, and will crash if it points
to Go memory that contains a pointer.

Fixes #15942.

Change-Id: Ic2d07ed9648d4b27078ae7683e26196bcbc59fc9
Reviewed-on: https://go-review.googlesource.com/33237
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-15 17:10:52 +00:00
David Crawshaw
fab3fcaf75 cmd/go: use build ID as plugin symbol prefix
Updates #17821

Change-Id: Iebd2e88b2d4f3d757ffad72456f4bfc0607d8110
Reviewed-on: https://go-review.googlesource.com/33162
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-11-15 16:17:07 +00:00
David Crawshaw
03da2690c9 cmd/link, runtime, plugin: versioning
In plugins and every program that opens a plugin, include a hash of
every imported package.

There are two versions of each hash: one local and one exported.
As the program starts and plugins are loaded, the first exported
symbol for each package becomes the canonical version.

Any subsequent plugin's local package hash symbol has to match the
canonical version.

Fixes #17832

Change-Id: I4e62c8e1729d322e14b1673bada40fa7a74ea8bc
Reviewed-on: https://go-review.googlesource.com/33161
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-11-15 16:14:27 +00:00
Ian Lance Taylor
a145890059 all: don't call t.Fatal from a goroutine
Fixes #17900.

Change-Id: I42cda6ac9cf48ed739d3a015a90b3cb15edf8ddf
Reviewed-on: https://go-review.googlesource.com/33243
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-15 15:13:48 +00:00
Brad Fitzpatrick
9be14c4058 net: add test that TCP Close unblocks blocked Reads
I guess this was fixed at some point. Remove a skipped test in
net/http and add an explicit test in net.

Fixes #17695

Change-Id: Idb9f3e236b726bb45098474b830c95c1fce57529
Reviewed-on: https://go-review.googlesource.com/33242
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-11-15 14:22:31 +00:00
Ian Lance Taylor
b687d6a788 misc/cgo/testcarchive, misc/cgo/testcshared: sleep instead of sched_yield
Apparently when GOMAXPROCS == 1 a simple sched_yield in a tight loop is
not necessarily sufficient to permit a signal handler to run. Instead,
sleep for 1/1000 of a second.

Fixes #16649.

Change-Id: I83910144228556e742b7a92a441732ef61aa49d9
Reviewed-on: https://go-review.googlesource.com/33239
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-15 05:35:54 +00:00
Caleb Spare
1e91731251 html/template: fix multiple Clones of redefined template
This change redoes the fix for #16101 (CL 31092) in a different way by
making t.Clone return the template associated with the t.Name() while
allowing for the case that a template of the same name is define-d.

Fixes #17735.

Change-Id: I1e69672390a4c81aa611046a209008ae4a3bb723
Reviewed-on: https://go-review.googlesource.com/33210
Run-TryBot: Caleb Spare <cespare@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-11-15 04:30:20 +00:00
Mikio Hara
91461002f3 os: gofmt -w -s
Change-Id: I9a42cb55544185ade20b2a4a9de5d39a6cfc6fc6
Reviewed-on: https://go-review.googlesource.com/33172
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-15 03:55:56 +00:00
Brad Fitzpatrick
90d536f3ca net/http: update bundled http2 for write scheduling order fix
Updates x/net/http2 to x/net git rev 00ed5e9 for:

    http2: schedule RSTStream writes onto its stream's queue
    https://golang.org/cl/33238

Fixes #17243

Change-Id: I79cc5d15bf69ead28d549d4f798c12f4ee2a2201
Reviewed-on: https://go-review.googlesource.com/33241
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-11-15 01:52:44 +00:00
Rob Pike
24a088d20a text/template: efficient reporting of line numbers
Instead of scanning the text to count newlines, which is n², keep track as we go
and store the line number in the token.

benchmark                 old ns/op      new ns/op     delta
BenchmarkParseLarge-4     1589721293     38783310      -97.56%

Fixes #17851

Change-Id: I231225c61e667535e2ce55cd2facea6d279cc59d
Reviewed-on: https://go-review.googlesource.com/33234
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-15 00:42:33 +00:00
Brad Fitzpatrick
bb00a8d97f net/http: update bundled http2, add TestServerKeepAlivesEnabled h1/h2 tests
Updates x/net/http2 to x/net git rev 6dfeb344 for:

   http2: make Server respect http1 Server's SetKeepAlivesEnabled
   https://golang.org/cl/33153

And adds a test in std.

Fixes #17717

Change-Id: I3ba000abb6f3f682261e105d8a4bb93bde6609fe
Reviewed-on: https://go-review.googlesource.com/33231
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tom Bergan <tombergan@google.com>
2016-11-14 22:39:50 +00:00
Brad Fitzpatrick
b83350a2e0 Revert "text/template: efficient reporting of line numbers"
This reverts commit 794fb71d9c.

Reason for revert: submitted without TryBots and it broke all three race builders.

Change-Id: I80a1e566616f0ee8fa3529d4eeee04268f8a713b
Reviewed-on: https://go-review.googlesource.com/33232
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-14 22:23:24 +00:00
Marcel Edmund Franke
2442b49c47 html/template: typo fix
comment on unexported function starts with wrong functionname

Change-Id: Ib16c2fe42b5a8d4606ed719f620923c17839d091
Reviewed-on: https://go-review.googlesource.com/33203
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-14 21:28:31 +00:00
Rob Pike
794fb71d9c text/template: efficient reporting of line numbers
Instead of scanning the text to count newlines, which is n², keep track as we go
and store the line number in the token.

benchmark                 old ns/op      new ns/op     delta
BenchmarkParseLarge-4     1589721293     38783310      -97.56%

Fixes #17851

Change-Id: Ieaf89a35e371b405ad92e38baa1e3fa98d18cfb4
Reviewed-on: https://go-review.googlesource.com/32923
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-11-14 18:42:48 +00:00
Josh Bleecher Snyder
2f76c1985f cmd/go/testdata/src: gofmt
These are functionality tests, not formatter tests.

I also tested manually that 'go test cmd/go'
without -short still passes.


Change-Id: Id146e1dc3b65e19ea531869725cd0b97f4801b8b
Reviewed-on: https://go-review.googlesource.com/33169
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-14 00:24:27 +00:00