]> Cypherpunks repositories - gostls13.git/log
gostls13.git
11 years agocmd/yacc: gofmt y.go
ChaiShushan [Wed, 18 Dec 2013 20:17:08 +0000 (15:17 -0500)]
cmd/yacc: gofmt y.go

R=golang-dev, adg, rsc
CC=golang-dev
https://golang.org/cl/36950043

11 years agoimage/gif: respect local color table transparency.
Nigel Tao [Wed, 18 Dec 2013 20:10:40 +0000 (15:10 -0500)]
image/gif: respect local color table transparency.

Fixes #6441.

R=r
CC=andybons, golang-dev
https://golang.org/cl/13829043

11 years agocmd/6g, cmd/gc, cmd/ld: fix Plan 9 amd64 warnings
David du Colombier [Wed, 18 Dec 2013 19:20:46 +0000 (20:20 +0100)]
cmd/6g, cmd/gc, cmd/ld: fix Plan 9 amd64 warnings

warning: src/cmd/6g/reg.c:671 format mismatch d VLONG, arg 4
warning: src/cmd/gc/pgen.c:230 set and not used: oldstksize
warning: src/cmd/gc/plive.c:877 format mismatch lx UVLONG, arg 2
warning: src/cmd/gc/walk.c:2878 set and not used: cbv
warning: src/cmd/gc/walk.c:2885 set and not used: hbv
warning: src/cmd/ld/data.c:198 format mismatch s IND FUNC(IND CHAR) INT, arg 2
warning: src/cmd/ld/data.c:230 format mismatch s IND FUNC(IND CHAR) INT, arg 2
warning: src/cmd/ld/dwarf.c:1517 set and not used: pc
warning: src/cmd/ld/elf.c:1507 format mismatch d VLONG, arg 2
warning: src/cmd/ld/ldmacho.c:509 set and not used: dsymtab

R=golang-dev, gobot, rsc
CC=golang-dev
https://golang.org/cl/36740045

11 years agolibmach, cmd/8l: fix Plan 9 warnings
David du Colombier [Wed, 18 Dec 2013 19:19:59 +0000 (20:19 +0100)]
libmach, cmd/8l: fix Plan 9 warnings

warning: src/libmach/sym.c:1861 non-interruptable temporary
warning: src/cmd/8l/../ld/pcln.c:29 set and not used: p

R=golang-dev, gobot, rsc
CC=golang-dev
https://golang.org/cl/40500043

11 years agoliblink: fix Plan 9 warnings
David du Colombier [Wed, 18 Dec 2013 19:19:29 +0000 (20:19 +0100)]
liblink: fix Plan 9 warnings

warning: src/liblink/asm5.c:485 non-interruptable temporary
warning: src/liblink/asm5.c:565 set and not used: c
warning: src/liblink/asm5.c:622 format mismatch ux VLONG, arg 2
warning: src/liblink/asm5.c:1218 overspecified class: asmout GLOBL STATIC
warning: src/liblink/asm5.c:2088 overspecified class: oprrr GLOBL STATIC
warning: src/liblink/asm5.c:2202 overspecified class: opbra GLOBL STATIC
warning: src/liblink/asm5.c:2237 overspecified class: olr GLOBL STATIC
warning: src/liblink/asm5.c:2266 overspecified class: olhr GLOBL STATIC
warning: src/liblink/asm5.c:2291 overspecified class: osr GLOBL STATIC
warning: src/liblink/asm5.c:2302 overspecified class: oshr GLOBL STATIC
warning: src/liblink/asm5.c:2312 overspecified class: osrr GLOBL STATIC
warning: src/liblink/asm5.c:2319 overspecified class: oshrr GLOBL STATIC
warning: src/liblink/asm5.c:2325 overspecified class: olrr GLOBL STATIC
warning: src/liblink/asm5.c:2332 overspecified class: olhrr GLOBL STATIC
warning: src/liblink/asm5.c:2338 overspecified class: ofsr GLOBL STATIC
warning: src/liblink/asm5.c:2375 overspecified class: omvl GLOBL STATIC
warning: src/liblink/asm8.c:1261 format mismatch d VLONG, arg 3
warning: src/liblink/asm8.c:1274 format mismatch +d VLONG, arg 5
warning: src/liblink/list5.c:153 format mismatch d VLONG, arg 3
warning: src/liblink/list5.c:310 format mismatch d VLONG, arg 3
warning: src/liblink/obj6.c:665 set and not used: q
warning: src/liblink/pcln.c:32 set and not used: p

R=golang-dev, jas, gobot, rsc
CC=golang-dev
https://golang.org/cl/40370043

11 years agofmt: use sync.Pool
Brad Fitzpatrick [Wed, 18 Dec 2013 19:09:07 +0000 (11:09 -0800)]
fmt: use sync.Pool

Update #4720

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/43990043

11 years agosync: add Pool type
Brad Fitzpatrick [Wed, 18 Dec 2013 19:08:34 +0000 (11:08 -0800)]
sync: add Pool type

Adds the Pool type and docs, and use it in fmt.
This is a temporary implementation, until Dmitry
makes it fast.

Uses the API proposal from Russ in http://goo.gl/cCKeb2 but
adds an optional New field, as used in fmt and elsewhere.
Almost all callers want that.

Update #4720

R=golang-dev, rsc, cshapiro, iant, r, dvyukov, khr
CC=golang-dev
https://golang.org/cl/41860043

11 years agoapi: update next.txt
Brad Fitzpatrick [Wed, 18 Dec 2013 18:37:27 +0000 (10:37 -0800)]
api: update next.txt

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/43490048

11 years agoliblink: don't search for an import file with an absolute path
Ian Lance Taylor [Wed, 18 Dec 2013 18:33:47 +0000 (10:33 -0800)]
liblink: don't search for an import file with an absolute path

This restores the old behaviour, and makes it possible to
continue to use 6g and 6l directly, rather than the go tool,
with dot imports.

R=rsc
CC=golang-dev
https://golang.org/cl/43710043

11 years agocmd/nm: minor cleanup from previous CL
Russ Cox [Wed, 18 Dec 2013 18:29:40 +0000 (13:29 -0500)]
cmd/nm: minor cleanup from previous CL

I forgot to apply Ian's suggestions before submitting CL 40600043.

R=iant
CC=golang-dev
https://golang.org/cl/43560045

11 years agoencoding/csv: remove unused unreadRune function
Shawn Smith [Wed, 18 Dec 2013 18:29:27 +0000 (13:29 -0500)]
encoding/csv: remove unused unreadRune function

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/37720046

11 years agohtml: add tests for UnescapeString edge cases
Shawn Smith [Wed, 18 Dec 2013 18:20:25 +0000 (10:20 -0800)]
html: add tests for UnescapeString edge cases

R=golang-dev, gobot, bradfitz
CC=golang-dev
https://golang.org/cl/40810044

11 years agoencoding/asn1: add more test cases for BitString.At and TestUTCTime, add test for...
Shawn Smith [Wed, 18 Dec 2013 18:19:07 +0000 (10:19 -0800)]
encoding/asn1: add more test cases for BitString.At and TestUTCTime, add test for ObjectIdentifier.Equal

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/42740043

11 years agoencoding/json: add test for HTMLEscape
Shawn Smith [Wed, 18 Dec 2013 18:18:35 +0000 (10:18 -0800)]
encoding/json: add test for HTMLEscape

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/38220044

11 years agomisc/notepadplus: Fix Function List in Notepad++ 6.5
ChaiShushan [Wed, 18 Dec 2013 18:17:38 +0000 (10:17 -0800)]
misc/notepadplus: Fix Function List in Notepad++ 6.5

Since version 6.5, npp change the Function List syntax for User Defined Languages.
We need use userDefinedLangName syntax in association tag in Notepad++ 6.5.

Fix issue 6735.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/22770043

11 years agogo/ast: added example illustrating CommentMap use.
Robert Griesemer [Wed, 18 Dec 2013 18:10:40 +0000 (10:10 -0800)]
go/ast: added example illustrating CommentMap use.

R=bradfitz
CC=golang-dev
https://golang.org/cl/43930043

11 years agoencoding/ascii85: add empty string case for Encode test
Shawn Smith [Wed, 18 Dec 2013 16:33:59 +0000 (08:33 -0800)]
encoding/ascii85: add empty string case for Encode test

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/36830046

11 years agonet: test dnsconfig_unix with sample resolv.conf
Anfernee Yongkun Gui [Wed, 18 Dec 2013 16:26:36 +0000 (08:26 -0800)]
net: test dnsconfig_unix with sample resolv.conf

R=golang-dev, adg, bradfitz, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/21580043

11 years agocrypto/x509: set default signature hash to SHA256 and allow override.
Adam Langley [Wed, 18 Dec 2013 15:57:56 +0000 (10:57 -0500)]
crypto/x509: set default signature hash to SHA256 and allow override.

Previously the hash used when signing an X.509 certificate was fixed
and, for RSA, it was fixed to SHA1. Since Microsoft have announced the
deprecation of SHA1 in X.509 certificates, this change switches the
default to SHA256.

It also allows the hash function to be controlled by the caller by
setting the SignatureAlgorithm field of the template.

[1] http://blogs.technet.com/b/pki/archive/2013/11/12/sha1-deprecation-policy.aspx

Fixes #5302.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/40720047

11 years agocrypto/x509: add non-cgo darwin system anchor certs
Josh Bleecher Snyder [Wed, 18 Dec 2013 15:57:07 +0000 (10:57 -0500)]
crypto/x509: add non-cgo darwin system anchor certs

The set of certs fetched via exec'ing `security` is not quite identical
to the certs fetched via the cgo call. The cgo fetch includes
any trusted root certs that the user may have added; exec does not.
The exec fetch includes an Apple-specific root cert; the cgo fetch
does not. Other than that, they appear to be the same.

Unfortunately, os/exec depends on crypto/x509, via net/http. Break the
circular dependency by moving the exec tests to their own package.

This will not work in iOS; we'll cross that bridge when we get to it.

R=golang-dev, minux.ma, agl
CC=golang-dev
https://golang.org/cl/22020045

11 years agoencoding/json: speed up decoding
Brad Fitzpatrick [Wed, 18 Dec 2013 15:30:21 +0000 (07:30 -0800)]
encoding/json: speed up decoding

Don't make copies of keys while decoding, and don't use the
expensive strings.EqualFold when it's not necessary. Instead,
note in the existing field cache what algorithm to use to
check fold equality... most keys are just ASCII letters.

benchmark               old ns/op    new ns/op    delta
BenchmarkCodeDecoder    137074314    103974418  -24.15%

benchmark                old MB/s     new MB/s  speedup
BenchmarkCodeDecoder        14.16        18.66    1.32x

Update #6496

R=golang-dev, rsc, adg, r, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/13894045

11 years agoA+C: Anfernee Yongkun Gui (individual CLA)
Brad Fitzpatrick [Wed, 18 Dec 2013 12:06:56 +0000 (04:06 -0800)]
A+C: Anfernee Yongkun Gui (individual CLA)

Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/43760046

11 years agolog: fix example (fix build)
Andrew Gerrand [Wed, 18 Dec 2013 06:25:23 +0000 (17:25 +1100)]
log: fix example (fix build)

R=golang-dev
CC=golang-dev
https://golang.org/cl/43780043

11 years agolog: add example
ChaiShushan [Wed, 18 Dec 2013 05:24:11 +0000 (16:24 +1100)]
log: add example

Fixes #6028.

R=golang-dev, bradfitz, adg, r
CC=golang-dev
https://golang.org/cl/43320043

11 years agoA+C: Nicolas Antonius Ernst Leopold Maria Kaiser (individual CLA)
Andrew Gerrand [Wed, 18 Dec 2013 04:48:05 +0000 (15:48 +1100)]
A+C: Nicolas Antonius Ernst Leopold Maria Kaiser (individual CLA)

Generated by addca.

R=gobot, nikai
CC=golang-dev
https://golang.org/cl/43620043

11 years agoflag: remove unused FlagSet.exitOnError field
ChaiShushan [Wed, 18 Dec 2013 04:18:12 +0000 (23:18 -0500)]
flag: remove unused FlagSet.exitOnError field

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/14279043

11 years agonet: make TestDNSThreadLimit execute at the end of tests
Mikio Hara [Wed, 18 Dec 2013 04:05:47 +0000 (13:05 +0900)]
net: make TestDNSThreadLimit execute at the end of tests

Because TestDNSThreadLimit consumes tons of file descriptors and
makes other tests flaky when CGO_ENABLE=0 or being with netgo tag.

Fixes #6580.

R=golang-dev, bradfitz, adg, minux.ma
CC=golang-dev
https://golang.org/cl/14639044

11 years agoliblink: rewrite '\\' in paths to '/' on windows
Shenghou Ma [Wed, 18 Dec 2013 03:40:13 +0000 (22:40 -0500)]
liblink: rewrite '\\' in paths to '/' on windows
At least three Go tests rely on that (log, runtime/{pprof,debug}).

Fixes #6972.
Fixes #6974.
Fixes #6975.

R=alex.brainman, mattn.jp, rsc
CC=golang-dev
https://golang.org/cl/43150043

11 years agoruntime: skip broken TestRuntimeGogoBytes on windows
Alex Brainman [Wed, 18 Dec 2013 03:17:47 +0000 (14:17 +1100)]
runtime: skip broken TestRuntimeGogoBytes on windows

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/43730043

11 years agocmd/go: avoid use of 'go tool pack'
Russ Cox [Wed, 18 Dec 2013 02:44:36 +0000 (21:44 -0500)]
cmd/go: avoid use of 'go tool pack'

All packages now use the -pack option to the compiler.
For a pure Go package, that's enough.
For a package with additional C and assembly files, the extra
archive entries can be added directly (by concatenation)
instead of by invoking go tool pack.

These changes make it possible to rewrite cmd/pack in Go.

R=iant, r
CC=golang-dev
https://golang.org/cl/42910043

11 years agocmd/dist: avoid use of 'go tool pack'
Russ Cox [Wed, 18 Dec 2013 02:44:18 +0000 (21:44 -0500)]
cmd/dist: avoid use of 'go tool pack'

All packages now use the -pack option to the compiler.
For a pure Go package, that's enough.
For a package with additional C and assembly files, the extra
archive entries can be added directly (by concatenation)
instead of by invoking go tool pack.

These changes make it possible to rewrite cmd/pack in Go.

R=iant, r
CC=golang-dev
https://golang.org/cl/42890043

11 years agocmd/gc: implement -pack flag
Russ Cox [Wed, 18 Dec 2013 02:43:33 +0000 (21:43 -0500)]
cmd/gc: implement -pack flag

The -pack flag causes 5g, 6g, 8g to write a Go archive directly,
instead of requiring the use of 'go tool pack' to convert the .5/.6/.8
to .a format.

Writing directly avoids the copy and also avoids having the
export data stored twice in the archive (once in __.PKGDEF,
once in .5/.6/.8).

A separate CL will enable the use of this flag by cmd/go.

Other build systems that do not know about -pack will be unaffected.

The changes to cmd/ld handle a minor simplification to the format:
an unused section is removed.

R=iant, r
CC=golang-dev
https://golang.org/cl/42880043

11 years agoruntime, gc: call interface conversion routines by reference.
Keith Randall [Wed, 18 Dec 2013 00:55:06 +0000 (16:55 -0800)]
runtime, gc: call interface conversion routines by reference.

Part of getting rid of vararg C calls.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/23310043

11 years agonet: rewrite toLower more clearly
David du Colombier [Wed, 18 Dec 2013 00:32:27 +0000 (16:32 -0800)]
net: rewrite toLower more clearly

Rob suggested this change.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/43670044

11 years agoruntime: don't store evacuate bit as low bit of hashtable overflow pointer.
Keith Randall [Tue, 17 Dec 2013 23:23:31 +0000 (15:23 -0800)]
runtime: don't store evacuate bit as low bit of hashtable overflow pointer.

Hash tables currently store an evacuated bit in the low bit
of the overflow pointer.  That's probably not sustainable in the
long term as GC wants correctly typed & aligned pointers.  It is
also a pain to move any of this code to Go in the current state.

This change moves the evacuated bit into the tophash entries.

Performance change is negligable.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/14412043

11 years agodatabase/sql: Fix inaccurate comment
Marko Tiikkaja [Tue, 17 Dec 2013 22:53:31 +0000 (14:53 -0800)]
database/sql: Fix inaccurate comment

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/40370051

11 years agoreflect: Add tests for Call with functions taking and returning structs.
Michael Hudson-Doyle [Tue, 17 Dec 2013 22:49:51 +0000 (14:49 -0800)]
reflect: Add tests for Call with functions taking and returning structs.

gccgo has problems using reflect.Call with functions that take and
return structs with no members.  Prior to fixing that problem there, I
thought it sensible to add some tests of this situation.

Update #6761

First contribution to Go, apologies in advance if I'm doing it wrong.

R=golang-dev, dave, minux.ma, iant, khr, bradfitz
CC=golang-dev
https://golang.org/cl/26570046

11 years agoC+A: add Michael Hudson (Linaro CLA)
Brad Fitzpatrick [Tue, 17 Dec 2013 22:49:07 +0000 (14:49 -0800)]
C+A: add Michael Hudson (Linaro CLA)

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/43670043

11 years agocontainer/list: Add missing period to doc comment for Front
Caleb Spare [Tue, 17 Dec 2013 22:21:11 +0000 (14:21 -0800)]
container/list: Add missing period to doc comment for Front

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/38540046

11 years agonet: reimplement toLower to not depend on strings
David du Colombier [Tue, 17 Dec 2013 22:19:11 +0000 (14:19 -0800)]
net: reimplement toLower to not depend on strings

R=golang-dev, r, bradfitz
CC=golang-dev, jas
https://golang.org/cl/43610043

11 years agoruntime: don't crash in SetFinalizer if sizeof *x is zero
Brad Fitzpatrick [Tue, 17 Dec 2013 22:18:58 +0000 (14:18 -0800)]
runtime: don't crash in SetFinalizer if sizeof *x is zero

And document it explicitly, even though it already said
it wasn't guaranteed.

Fixes #6857

R=golang-dev, khr
CC=golang-dev
https://golang.org/cl/43580043

11 years agodatabase/sql: fix typo in comment
Arne Hormann [Tue, 17 Dec 2013 21:17:43 +0000 (08:17 +1100)]
database/sql: fix typo in comment

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/43300043

11 years agoA+C: Arne Hormann (individual CLA)
Andrew Gerrand [Tue, 17 Dec 2013 21:17:17 +0000 (08:17 +1100)]
A+C: Arne Hormann (individual CLA)

Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/43600043

11 years agoos: avoid a string concat in readdir
Brad Fitzpatrick [Tue, 17 Dec 2013 20:25:32 +0000 (12:25 -0800)]
os: avoid a string concat in readdir

R=golang-dev, crawshaw
CC=golang-dev
https://golang.org/cl/37690045

11 years agoos, path/filepath: don't ignore Lstat errors in Readdir
Brad Fitzpatrick [Tue, 17 Dec 2013 20:19:01 +0000 (12:19 -0800)]
os, path/filepath: don't ignore Lstat errors in Readdir

os: don't ignore LStat errors in Readdir. If it's ENOENT,
on the second pass, just treat it as missing. If it's another
error, it's real.

path/filepath: use ReaddirNames instead of Readdir in Walk,
in order to obey the documented WalkFunc contract of returning
each walked item's LStat error, if any.

Fixes #6656
Fixes #6680

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/43530043

11 years agodatabase/sql: fix auto-reconnect in prepared statements
Julien Schmidt [Tue, 17 Dec 2013 19:57:30 +0000 (11:57 -0800)]
database/sql: fix auto-reconnect in prepared statements

This also fixes several connection leaks.
Fixes #5718

R=bradfitz, adg
CC=alberto.garcia.hierro, golang-dev
https://golang.org/cl/14920046

11 years agoimage: roll back 13239051 (add RGB and RGB48)
Rob Pike [Tue, 17 Dec 2013 18:49:45 +0000 (10:49 -0800)]
image: roll back 13239051 (add RGB and RGB48)

They cause too much bloat in the internals as we find ourselves adding
special case code for all the cross-connections. It's better to use RGBA
and just max out the alpha. We lose a little memory but reduce the number
of special cases the encoders, decoders, and drawers need to provide.

R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/42910045

11 years agold: fix Plan 9 build
David du Colombier [Tue, 17 Dec 2013 16:46:07 +0000 (08:46 -0800)]
ld: fix Plan 9 build

R=golang-dev, jas, bradfitz
CC=golang-dev
https://golang.org/cl/43420043

11 years agoall: add missing copyright
ChaiShushan [Tue, 17 Dec 2013 14:52:32 +0000 (06:52 -0800)]
all: add missing copyright

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/43290043

11 years agocmd/ld: maintain correct headstring needed by windows port.
Shenghou Ma [Tue, 17 Dec 2013 12:36:01 +0000 (07:36 -0500)]
cmd/ld: maintain correct headstring needed by windows port.
Fixes build for go_bootstrap.
Fixes #6971.

R=alex.brainman, mattn.jp, rsc
CC=golang-dev
https://golang.org/cl/43130043

11 years agorace.bat: set exit status
Dmitriy Vyukov [Tue, 17 Dec 2013 11:09:42 +0000 (15:09 +0400)]
race.bat: set exit status

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/43340043

11 years agorace.bat: fix env setup
Dmitriy Vyukov [Tue, 17 Dec 2013 08:59:13 +0000 (12:59 +0400)]
race.bat: fix env setup

Currently it fails as:
go tool dist: $GOROOT is not set correctly or not exported
GOROOT=c:\go
c:\go\include\u.h does not exist
Fail.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/42550044

11 years agotime: fix test error in Chinese edition of Windows
Shenghou Ma [Tue, 17 Dec 2013 07:43:14 +0000 (02:43 -0500)]
time: fix test error in Chinese edition of Windows
On the Chinese Windows XP system that I'm using, GetTimeZoneInformation returns a struct containing "中国标准时间" (China Standard Time in Chinese) in both StandardName and DaylightName (which is correct, because China does not use DST). However, in registry, under key HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\China Standard Time, the key Std and Dlt contain "中国标准时间" (China Standard Time in Chinese) and "中国夏季时间" (China Summer Time in Chinese) respectively. This means that time.toEnglishName() cannot determine the abbreviation for the local timezone (CST) and causes test failures (time.Local is empty)

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/43210043

11 years agomath/rand: minor optimization to Perm
Josh Bleecher Snyder [Tue, 17 Dec 2013 02:49:34 +0000 (13:49 +1100)]
math/rand: minor optimization to Perm

Instead of writing out 0..n and then reading it
back, just use i when it is needed.

Wikipedia calls this the "inside-out" implementation:
http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle

This yields identical values to the previous
implementation, given the same seed. (Note that the
output from Example_rand is unchanged.)

2.8 GHz Intel Core i7, results very stable:

benchmark          old ns/op    new ns/op    delta
BenchmarkPerm3           138          136   -1.45%
BenchmarkPerm30          825          803   -2.67%

Stock Raspberry Pi, minimum improvement out of three runs:

benchmark          old ns/op    new ns/op    delta
BenchmarkPerm3          5774         5664   -1.91%
BenchmarkPerm30        32582        29381   -9.82%

R=golang-dev, dave, mtj, adg
CC=golang-dev
https://golang.org/cl/21030043

11 years agocmd/go: set GOROOT when testing "go install cmd/fix"
Andrew Gerrand [Tue, 17 Dec 2013 01:17:56 +0000 (12:17 +1100)]
cmd/go: set GOROOT when testing "go install cmd/fix"

This particular test would never pass unless you had GOROOT set in your
environment. This changes makes the test use the baked-in GOROOT, as it
does with GOOS and GOARCH.

R=golang-dev, dave, iant
CC=golang-dev
https://golang.org/cl/43080043

11 years agomisc/vim: use shiftwidth() instead of &sw if available.
Shenghou Ma [Tue, 17 Dec 2013 01:05:48 +0000 (20:05 -0500)]
misc/vim: use shiftwidth() instead of &sw if available.
Fixes #6841.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/43010044

11 years agocmd/gc: fix comparison order of parameters in mpcmpfltc(a, b)
Shenghou Ma [Mon, 16 Dec 2013 21:54:10 +0000 (16:54 -0500)]
cmd/gc: fix comparison order of parameters in mpcmpfltc(a, b)
It should compare a - b to 0, not b - a to 0.
Fixes #6964.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/39020044

11 years agodatabase/sql: Check errors in QueryRow.Scan
Marko Tiikkaja [Mon, 16 Dec 2013 20:48:35 +0000 (12:48 -0800)]
database/sql: Check errors in QueryRow.Scan

The previous coding did not correctly check for errors from the driver's
Next() or Close(), which could mask genuine errors from the database, as
witnessed in issue #6651.

Even after this change errors from Close() will be ignored if the query
returned no rows (as Rows.Next will have closed the handle already), but it
is a lot easier for the drivers to guard against that.

Fixes #6651.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/41590043

11 years agoA+C: Marko Tiikkaja (individual CLA)
Brad Fitzpatrick [Mon, 16 Dec 2013 20:48:12 +0000 (12:48 -0800)]
A+C: Marko Tiikkaja (individual CLA)

Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/41940044

11 years agonet: lookup protocol in lower-case on Plan 9
David du Colombier [Mon, 16 Dec 2013 20:00:23 +0000 (12:00 -0800)]
net: lookup protocol in lower-case on Plan 9

Protocol keywords are case-insensitive,
but the Ndb database is case-sensitive.

Also use the generic net protocol instead
of tcp in lookupHost.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/40600047

11 years agostrings: Add example function for IndexAny
Daniel Lidén [Mon, 16 Dec 2013 18:50:56 +0000 (10:50 -0800)]
strings: Add example function for IndexAny

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/42310044

11 years agoA+C: Daniel Lidén (individual CLA)
Brad Fitzpatrick [Mon, 16 Dec 2013 18:48:51 +0000 (10:48 -0800)]
A+C: Daniel Lidén (individual CLA)

Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/42940043

11 years agostrings: Add IndexFunc example
Robin Eklind [Mon, 16 Dec 2013 18:44:23 +0000 (10:44 -0800)]
strings: Add IndexFunc example

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/42370043

11 years agostrings: Update Trim example.
Robin Eklind [Mon, 16 Dec 2013 18:40:28 +0000 (10:40 -0800)]
strings: Update Trim example.

Use an input which better shows that behaviour of the function. Only leading
and trailing runes are trimed, not intermediate ones.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/42390043

11 years agoruntime: fix test
Russ Cox [Mon, 16 Dec 2013 17:59:30 +0000 (12:59 -0500)]
runtime: fix test

Was supposed to be in the nm CL.

TBR=r
CC=golang-dev
https://golang.org/cl/42870043

11 years agoapi: update next.txt
Brad Fitzpatrick [Mon, 16 Dec 2013 17:57:41 +0000 (09:57 -0800)]
api: update next.txt

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/42860043

11 years agodebug/goobj: add package for reading new Go object files
Russ Cox [Mon, 16 Dec 2013 17:52:21 +0000 (12:52 -0500)]
debug/goobj: add package for reading new Go object files

R=golang-dev, r, iant
CC=golang-dev
https://golang.org/cl/40610043

11 years agocmd/nm: reimplement in Go
Russ Cox [Mon, 16 Dec 2013 17:52:11 +0000 (12:52 -0500)]
cmd/nm: reimplement in Go

The immediate goal is to support the new object file format,
which libmach (nm's support library) does not understand.
Rather than add code to libmach or reengineer liblink to
support this new use, just write it in Go.

The C version of nm reads the Plan 9 symbol table stored in
Go binaries, now otherwise unused.

This reimplementation uses the standard symbol table for
the corresponding file format instead, bringing us one step
closer to removing the Plan 9 symbol table from Go binaries.

Tell cmd/dist not to build cmd/nm anymore.
Tell cmd/go to install cmd/nm in the tool directory.

R=golang-dev, r, iant, alex.brainman
CC=golang-dev
https://golang.org/cl/40600043

11 years agocmd/ld: move instruction selection + layout into compilers, assemblers
Russ Cox [Mon, 16 Dec 2013 17:51:58 +0000 (12:51 -0500)]
cmd/ld: move instruction selection + layout into compilers, assemblers

- new object file reader/writer (liblink/objfile.c)
- remove old object file writing routines
- add pcdata iterator
- remove all trace of "line number stack" and "path fragments" from
  object files, linker (!!!)
- dwarf now writes a single "compilation unit" instead of one per package

This CL disables the check for chains of no-split functions that
could overflow the stack red zone. A future CL will attack the problem
of reenabling that check (issue 6931).

This CL is just the liblink and cmd/ld changes.
There are minor associated adjustments in CL 37030045.
Each depends on the other.

R=golang-dev, dave, iant
CC=golang-dev
https://golang.org/cl/39680043

11 years agocmd/cc, cmd/gc: update compilers, assemblers for liblink changes
Russ Cox [Mon, 16 Dec 2013 17:51:38 +0000 (12:51 -0500)]
cmd/cc, cmd/gc: update compilers, assemblers for liblink changes

- add buffered stdout to all tools and provide to link ctxt.
- avoid extra \n before ! in .6 files written by assemblers
  (makes them match the C compilers).
- use linkwriteobj instead of linkouthist+linkwritefuncs.
- in assemblers and C compilers, record pc explicitly in Prog,
  for use by liblink.
- in C compilers, preserve jump target links.
- in Go compilers (gsubr.c) attach gotype directly to
  corresponding LSym* instead of rederiving from instruction stream.
- in Go compilers, emit just one definition for runtime.zerovalue
  from each compilation.

This CL consists entirely of small adjustments.
The heavy lifting is in CL 39680043.
Each depends on the other.

R=golang-dev, dave, iant
CC=golang-dev
https://golang.org/cl/37030045

11 years agostrings: Add FieldsFunc example.
Robin Eklind [Mon, 16 Dec 2013 17:43:03 +0000 (09:43 -0800)]
strings: Add FieldsFunc example.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/42360043

11 years agodoc/install-source.html: mention make.bash to skip tests
Shenghou Ma [Mon, 16 Dec 2013 02:03:12 +0000 (21:03 -0500)]
doc/install-source.html: mention make.bash to skip tests

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/42590043

11 years agounicode/utf16: add explicit test for decoding invalid runes.
Dave Cheney [Mon, 16 Dec 2013 01:35:25 +0000 (12:35 +1100)]
unicode/utf16: add explicit test for decoding invalid runes.

The EncodeRune test exercises DecodeRune, but only for runes that it can encode. Add an explicit test for invalid utf16 surrogate pairs.

Bonus: coverage is now 100%

unicode/utf16/utf16.go: IsSurrogate     100.0%
unicode/utf16/utf16.go: DecodeRune      100.0%
unicode/utf16/utf16.go: EncodeRune      100.0%
unicode/utf16/utf16.go: Encode          100.0%
unicode/utf16/utf16.go: Decode          100.0%
total:                  (statements)    100.0%

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/39150044

11 years agounicode/utf16: add explicit tests for IsSurrogate
Dave Cheney [Mon, 16 Dec 2013 00:15:23 +0000 (11:15 +1100)]
unicode/utf16: add explicit tests for IsSurrogate

Update #6956

Add tests for IsSurrogate.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/42570043

11 years agodoc/articles/wiki: remove GNU make dependency
Aram Hăvărneanu [Sun, 15 Dec 2013 22:51:03 +0000 (17:51 -0500)]
doc/articles/wiki: remove GNU make dependency

R=golang-dev, adg, minux.ma
CC=golang-dev
https://golang.org/cl/38410043

11 years agocrypto/tls: generate random serial numbers.
Adam Langley [Sun, 15 Dec 2013 17:57:57 +0000 (12:57 -0500)]
crypto/tls: generate random serial numbers.

NSS (used in Firefox and Chrome) won't accept two certificates with the same
issuer and serial. But this causes problems with self-signed certificates
with a fixed serial number.

This change randomises the serial numbers in the certificates generated by
generate_cert.go.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/38290044

11 years agocrypto/cipher: fix CFB mode.
Adam Langley [Sun, 15 Dec 2013 17:55:59 +0000 (12:55 -0500)]
crypto/cipher: fix CFB mode.

a073d65e6f8c had a couple of bugs in the CFB mode that I missed in code review:
        1) The loop condition wasn't updated from the old version.
        2) It wasn't safe when src and dst aliased.

Fixes #6950.

R=golang-dev, hanwen
CC=golang-dev
https://golang.org/cl/42110043

11 years agoA+C: Aram Hăvărneanu (individual CLA)
Andrew Gerrand [Fri, 13 Dec 2013 23:03:11 +0000 (10:03 +1100)]
A+C: Aram Hăvărneanu (individual CLA)

Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/42090043

11 years agoruntime: fix crash in runtime.GoroutineProfile
Russ Cox [Fri, 13 Dec 2013 20:44:57 +0000 (15:44 -0500)]
runtime: fix crash in runtime.GoroutineProfile

This is a possible Go 1.2.1 candidate.

Fixes #6946.

R=iant, r
CC=golang-dev
https://golang.org/cl/41640043

11 years agobytes: fix description of FieldsFunc
Shenghou Ma [Fri, 13 Dec 2013 03:13:19 +0000 (22:13 -0500)]
bytes: fix description of FieldsFunc
Similar to CL 3814041 that fixed the same issue in strings.
Fixes #6941.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/41490045

11 years agotest: match gccgo import error messages
Ian Lance Taylor [Fri, 13 Dec 2013 03:02:11 +0000 (19:02 -0800)]
test: match gccgo import error messages

Gccgo doesn't have the same equivalent of file name and
package as the gc compiler, so the error messages are
necessarily different.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/40510048

11 years ago.hgignore: remove duplicate entry
Ian Lance Taylor [Fri, 13 Dec 2013 03:01:50 +0000 (19:01 -0800)]
.hgignore: remove duplicate entry

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/40690048

11 years agodebug/dwarf: remove unused field addrsize from Data
Ian Lance Taylor [Fri, 13 Dec 2013 02:55:05 +0000 (18:55 -0800)]
debug/dwarf: remove unused field addrsize from Data

The addrsize field is not a constant for an entire executable
file, and is now handled by the dataFormat interface when
reading the data.

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/41620043

11 years agoreflect: correct function name in panic string
Ian Lance Taylor [Fri, 13 Dec 2013 02:54:48 +0000 (18:54 -0800)]
reflect: correct function name in panic string

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/36840045

11 years agodoc: change "threads" to "goroutines"
Ian Lance Taylor [Fri, 13 Dec 2013 02:48:40 +0000 (18:48 -0800)]
doc: change "threads" to "goroutines"

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/40510049

11 years ago.hgignore: remove merge markers
Ian Lance Taylor [Fri, 13 Dec 2013 01:25:02 +0000 (17:25 -0800)]
.hgignore: remove merge markers

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/40720049

11 years agotest: match gccgo error messages
Ian Lance Taylor [Fri, 13 Dec 2013 01:18:37 +0000 (17:18 -0800)]
test: match gccgo error messages

fixedbugs/issue4510.dir/f2.go:7: error: 'fmt' defined as both imported name and global name
f1.go:7: note: 'fmt' imported here

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/41530044

11 years agotest: match gccgo error messages
Ian Lance Taylor [Fri, 13 Dec 2013 01:18:12 +0000 (17:18 -0800)]
test: match gccgo error messages

const1.go:33: error: integer constant overflow
<similar errors omitted>
const1.go:64: error: division by zero
const1.go:67: error: floating point constant overflow
const1.go:68: error: floating point constant overflow
const1.go:69: error: floating point constant overflow
const1.go:70: error: division by zero
const1.go:71: error: expected integer type
const1.go:77: error: argument 1 has incompatible type (cannot use type int8 as type int)
const1.go:78: error: argument 1 has incompatible type (cannot use type int8 as type int)
const1.go:79: error: argument 1 has incompatible type (cannot use type uint8 as type int)
const1.go:81: error: argument 1 has incompatible type (cannot use type float32 as type int)
const1.go:82: error: argument 1 has incompatible type (cannot use type float64 as type int)
const1.go:83: error: floating point constant truncated to integer
const1.go:85: error: argument 1 has incompatible type (cannot use type float64 as type int)
const1.go:86: error: argument 1 has incompatible type (cannot use type string as type int)
const1.go:87: error: argument 1 has incompatible type (cannot use type bool as type int)
const1.go:90: error: const initializer cannot be nil
const1.go:91: error: expression is not constant
const1.go:92: error: expression is not constant
const1.go:93: error: invalid constant type
const1.go:94: error: invalid constant type
fixedbugs/bug462.go:17: error: unknown field 'os.File' in 'T'
fixedbugs/issue3705.go:9: error: cannot declare init - must be func
fixedbugs/issue4251.go:12: error: inverted slice range
fixedbugs/issue4251.go:16: error: inverted slice range
fixedbugs/issue4251.go:20: error: inverted slice range
fixedbugs/issue4405.go:11: error: invalid character 0x7 in identifier
fixedbugs/issue4405.go:12: error: invalid character 0x8 in identifier
fixedbugs/issue4405.go:13: error: invalid character 0xb in identifier
fixedbugs/issue4405.go:14: error: invalid character 0xc in identifier
fixedbugs/issue4429.go:15: error: expected pointer
fixedbugs/issue4517d.go:9: error: cannot import package as init
fixedbugs/issue4545.go:17: error: invalid context-determined non-integer type for left operand of shift
fixedbugs/issue4545.go:16: error: incompatible types in binary expression
fixedbugs/issue4610.go:15: error: expected ';' or '}' or newline
fixedbugs/issue4610.go:16: error: expected declaration
fixedbugs/issue4654.go:15: error: value computed is not used
<similar errors omitted>
fixedbugs/issue4776.go:9: error: program must start with package clause
fixedbugs/issue4776.go:9: error: expected ';' or newline after package clause
fixedbugs/issue4813.go:31: error: index must be integer
<similar errors omitted>
fixedbugs/issue4847.go:22: error: initialization expression for 'matchAny' depends upon itself
fixedbugs/issue5089.go:13: error: redefinition of 'bufio.Buffered': receiver name changed
fixedbugs/issue5089.go:11: note: previous definition of 'bufio.Buffered' was here
fixedbugs/issue5172.go:17: error: reference to undefined field or method 'bar'
fixedbugs/issue5172.go:18: error: reference to undefined field or method 'bar'
fixedbugs/issue5172.go:12: error: use of undefined type 'bar'
fixedbugs/issue5358.go:16: error: argument 2 has incompatible type
fixedbugs/issue5581.go:29: error: use of undefined type 'Blah'
funcdup.go:10: error: redefinition of 'i'
funcdup.go:10: note: previous definition of 'i' was here
<similar errors omitted>
funcdup2.go:10: error: redefinition of 'i'
funcdup2.go:10: note: previous definition of 'i' was here
<similar errors omitted>
slice3err.go:20: error: middle index required in 3-index slice
<similar errors omitted>
slice3err.go:20: error: final index required in 3-index slice
<similar errors omitted>
slice3err.go:21: error: final index required in 3-index slice
slice3err.go:46: error: invalid 3-index slice of string
<similar errors omitted>
slice3err.go:57: error: inverted slice range
<similar errors omitted>
slice3err.go:62: error: invalid slice index: capacity less than length
slice3err.go:64: error: invalid slice index: capacity less than start
slice3err.go:65: error: invalid slice index: capacity less than start
slice3err.go:66: error: invalid slice index: capacity less than start
slice3err.go:68: error: invalid slice index: capacity less than length
slice3err.go:70: error: invalid slice index: capacity less than start
slice3err.go:80: error: invalid slice index: capacity less than length
slice3err.go:82: error: invalid slice index: capacity less than start
slice3err.go:83: error: invalid slice index: capacity less than start
slice3err.go:84: error: invalid slice index: capacity less than start
slice3err.go:86: error: invalid slice index: capacity less than length
slice3err.go:88: error: invalid slice index: capacity less than start
slice3err.go:99: error: array index out of bounds
<similar errors omitted>
slice3err.go:106: error: invalid slice index: capacity less than length
slice3err.go:107: error: invalid slice index: capacity less than start
slice3err.go:118: error: invalid slice index: capacity less than length
slice3err.go:119: error: invalid slice index: capacity less than start
syntax/semi1.go:10: error: missing '{' after if clause
syntax/semi1.go:10: error: reference to undefined name 'x'
syntax/semi1.go:10: error: reference to undefined name 'y'
syntax/semi1.go:12: error: reference to undefined name 'z'
syntax/semi2.go:10: error: missing '{' after switch clause
syntax/semi2.go:10: error: reference to undefined name 'x'
syntax/semi3.go:10: error: missing '{' after for clause
syntax/semi3.go:10: error: reference to undefined name 'x'
syntax/semi3.go:10: error: reference to undefined name 'y'
syntax/semi3.go:10: error: reference to undefined name 'z'
syntax/semi3.go:12: error: reference to undefined name 'z'
syntax/semi4.go:11: error: missing '{' after for clause
syntax/semi4.go:10: error: reference to undefined name 'x'
syntax/semi4.go:12: error: reference to undefined name 'z'
typecheck.go:12: error: reference to undefined name 'b'
typecheck.go:17: error: reference to undefined name 'c'
typecheck.go:11: error: use of undefined type 'b'
typecheck.go:16: error: not enough arguments
typecheck.go:17: error: not enough arguments

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/41520044

11 years agotest: add []rune case to string_lit.go
Ian Lance Taylor [Fri, 13 Dec 2013 01:17:02 +0000 (17:17 -0800)]
test: add []rune case to string_lit.go

Gccgo managed to get this case wrong.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/41490044

11 years agotest: adjust issue4618 for gccgo allocation behaviour
Ian Lance Taylor [Fri, 13 Dec 2013 01:14:05 +0000 (17:14 -0800)]
test: adjust issue4618 for gccgo allocation behaviour

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/41550044

11 years agotest: disable large type/stack frame tests for gccgo
Ian Lance Taylor [Fri, 13 Dec 2013 01:13:46 +0000 (17:13 -0800)]
test: disable large type/stack frame tests for gccgo

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/40370052

11 years agotest: disable a couple of precise GC tests for gccgo
Ian Lance Taylor [Fri, 13 Dec 2013 01:13:27 +0000 (17:13 -0800)]
test: disable a couple of precise GC tests for gccgo

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/41610043

11 years agodoc: add Go 1.2 to release history page
Andrew Gerrand [Thu, 12 Dec 2013 22:31:49 +0000 (09:31 +1100)]
doc: add Go 1.2 to release history page

Fixes #6939.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/41540043

11 years agocrypto/rc4: fix type errors in pure Go implementation
Richard Musiol [Thu, 12 Dec 2013 19:32:31 +0000 (14:32 -0500)]
crypto/rc4: fix type errors in pure Go implementation

R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/40540049

11 years agocrypto/sha1: Optimise FUNC1 with alternate formulation
Nick Craig-Wood [Thu, 12 Dec 2013 19:26:36 +0000 (11:26 -0800)]
crypto/sha1: Optimise FUNC1 with alternate formulation

According to Wikipedia: http://en.wikipedia.org/wiki/SHA-1
there is an alternate formulation for the FUNC1 transform,
namely

f1 = d xor (b and (c xor d))

instead of

f1 = (b and c) or ((not b) and d)

This reduces the instruction count of FUNC1 from 6 to 4 and
makes about 5% speed improvement on amd64 and suprisingly 17%
on 386.

amd64 Intel(R) Core(TM) i7 CPU Q 820 @ 1.73GHz:

benchmark              old ns/op    new ns/op    delta
BenchmarkHash8Bytes          506          499   -1.38%
BenchmarkHash1K             3099         2961   -4.45%
BenchmarkHash8K            22292        21243   -4.71%

benchmark               old MB/s     new MB/s  speedup
BenchmarkHash8Bytes        15.80        16.00    1.01x
BenchmarkHash1K           330.40       345.82    1.05x
BenchmarkHash8K           367.48       385.63    1.05x

i386 Intel(R) Core(TM) i7 CPU Q 820 @ 1.73GHz:

benchmark              old ns/op    new ns/op    delta
BenchmarkHash8Bytes          647          615   -4.95%
BenchmarkHash1K             3673         3161  -13.94%
BenchmarkHash8K            26141        22374  -14.41%

benchmark               old MB/s     new MB/s  speedup
BenchmarkHash8Bytes        12.35        13.01    1.05x
BenchmarkHash1K           278.74       323.94    1.16x
BenchmarkHash8K           313.37       366.13    1.17x

The improvements on an Intel(R) Core(TM) i7-4770K CPU @
3.50GHz were almost identical.

R=golang-dev, r, hanwen
CC=golang-dev, rsc
https://golang.org/cl/19910043

11 years agoimage: add RGB and RGB48
ChaiShushan [Thu, 12 Dec 2013 19:24:27 +0000 (11:24 -0800)]
image: add RGB and RGB48

R=golang-dev, r, nigeltao
CC=golang-dev
https://golang.org/cl/13239051

11 years agodoc/go1.3.txt: first checkins: makerelease, liblink
Rob Pike [Thu, 12 Dec 2013 19:17:54 +0000 (11:17 -0800)]
doc/go1.3.txt: first checkins: makerelease, liblink

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/40650047

11 years agocrypto/cipher: speed up gcmInc32.
Han-Wen Nienhuys [Thu, 12 Dec 2013 16:25:17 +0000 (11:25 -0500)]
crypto/cipher: speed up gcmInc32.

The counter is not secret, so the code does not need to be
constant time.

benchmark                    old MB/s     new MB/s  speedup
BenchmarkAESGCMSeal1K           89.90        92.84    1.03x
BenchmarkAESGCMOpen1K           89.16        92.30    1.04x

R=agl
CC=golang-dev
https://golang.org/cl/40690046

11 years agofmt: Fix signed zero-padding for positive floats
Felix Geisendörfer [Thu, 12 Dec 2013 14:40:16 +0000 (06:40 -0800)]
fmt: Fix signed zero-padding for positive floats

Space padding still has the same issue, I will send a separate patch for that
if this one gets accepted.
Fixes #6856.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/35660043

11 years agoA+C: Felix Geisendörfer (individual CLA)
Rob Pike [Thu, 12 Dec 2013 14:39:57 +0000 (06:39 -0800)]
A+C: Felix Geisendörfer (individual CLA)

Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/40870048