]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agostrconv: include package and function name in error strings
Rob Pike [Tue, 13 Dec 2011 18:42:05 +0000 (10:42 -0800)]
strconv: include package and function name in error strings
Fixes #2548.

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

13 years agogodoc: text wrapping
Russ Cox [Tue, 13 Dec 2011 18:33:40 +0000 (13:33 -0500)]
godoc: text wrapping

Example:

PACKAGE

package utf8
    import "unicode/utf8"

    Package utf8 implements functions and constants to support text
    encoded in UTF-8.  This package calls a Unicode character a rune for
    brevity.

CONSTANTS

const (
    RuneError = unicode.ReplacementChar // the "error" Rune or "replacement character".
    RuneSelf  = 0x80                    // characters below Runeself are represented as themselves in a single byte.
    UTFMax    = 4                       // maximum number of bytes of a UTF-8 encoded Unicode character.
)
    Numbers fundamental to the encoding.

FUNCTIONS

func DecodeLastRune(p []byte) (r rune, size int)
    DecodeLastRune unpacks the last UTF-8 encoding in p and returns the
    rune and its width in bytes.

func DecodeLastRuneInString(s string) (r rune, size int)
    DecodeLastRuneInString is like DecodeLastRune but its input is a
    string.

func DecodeRune(p []byte) (r rune, size int)
    DecodeRune unpacks the first UTF-8 encoding in p and returns the rune
    and its width in bytes.

func DecodeRuneInString(s string) (r rune, size int)
    DecodeRuneInString is like DecodeRune but its input is a string.

func EncodeRune(p []byte, r rune) int
    EncodeRune writes into p (which must be large enough) the UTF-8
    encoding of the rune.  It returns the number of bytes written.

func FullRune(p []byte) bool
    FullRune reports whether the bytes in p begin with a full UTF-8
    encoding of a rune.  An invalid encoding is considered a full Rune
    since it will convert as a width-1 error rune.

func FullRuneInString(s string) bool
    FullRuneInString is like FullRune but its input is a string.

func RuneCount(p []byte) int
    RuneCount returns the number of runes in p.  Erroneous and short
    encodings are treated as single runes of width 1 byte.

func RuneCountInString(s string) (n int)
    RuneCountInString is like RuneCount but its input is a string.

func RuneLen(r rune) int
    RuneLen returns the number of bytes required to encode the rune.

func RuneStart(b byte) bool
    RuneStart reports whether the byte could be the first byte of an
    encoded rune.  Second and subsequent bytes always have the top two
    bits set to 10.

func Valid(p []byte) bool
    Valid reports whether p consists entirely of valid UTF-8-encoded
    runes.

func ValidString(s string) bool
    ValidString reports whether s consists entirely of valid UTF-8-encoded
    runes.

TYPES

type String struct {
    // contains filtered or unexported fields
}
    String wraps a regular string with a small structure that provides
    more efficient indexing by code point index, as opposed to byte index.
    Scanning incrementally forwards or backwards is O(1) per index
    operation (although not as fast a range clause going forwards).
    Random access is O(N) in the length of the string, but the overhead is
    less than always scanning from the beginning.  If the string is ASCII,
    random access is O(1).  Unlike the built-in string type, String has
    internal mutable state and is not thread-safe.

func NewString(contents string) *String
    NewString returns a new UTF-8 string with the provided contents.

func (s *String) At(i int) rune
    At returns the rune with index i in the String.  The sequence of runes
    is the same as iterating over the contents with a "for range" clause.

func (s *String) Init(contents string) *String
    Init initializes an existing String to hold the provided contents.
    It returns a pointer to the initialized String.

func (s *String) IsASCII() bool
    IsASCII returns a boolean indicating whether the String contains only
    ASCII bytes.

func (s *String) RuneCount() int
    RuneCount returns the number of runes (Unicode code points) in the
    String.

func (s *String) Slice(i, j int) string
    Slice returns the string sliced at rune positions [i:j].

func (s *String) String() string
    String returns the contents of the String.  This method also means the
    String is directly printable by fmt.Print.

Fixes #2479.

R=golang-dev, dsymonds, mattn.jp, r, gri, r
CC=golang-dev
https://golang.org/cl/5472051

13 years agogc: delete DUPOK definition
Russ Cox [Tue, 13 Dec 2011 18:25:48 +0000 (13:25 -0500)]
gc: delete DUPOK definition

The relevant header is already included.

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

13 years agoexp/ssh: improve client channel close behavior
Dave Cheney [Tue, 13 Dec 2011 15:27:17 +0000 (10:27 -0500)]
exp/ssh: improve client channel close behavior

R=gustav.paul
CC=golang-dev
https://golang.org/cl/5480062

13 years agogc: small fixes to fmt.c
Luuk van Dijk [Tue, 13 Dec 2011 08:15:46 +0000 (09:15 +0100)]
gc: small fixes to fmt.c

don't crash when printing error messages about symbols in a garbled state.
render OCOMPLIT in export mode.

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

13 years agogc: fix use of stackallocated AST node in generation of static initialisation code.
Luuk van Dijk [Tue, 13 Dec 2011 08:09:10 +0000 (09:09 +0100)]
gc: fix use of stackallocated AST node in generation of static initialisation code.

Fixes #2529

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

13 years agodoc/go1: time
Rob Pike [Tue, 13 Dec 2011 05:08:03 +0000 (21:08 -0800)]
doc/go1: time

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

13 years agodoc/go1: more package updates
Rob Pike [Tue, 13 Dec 2011 03:25:25 +0000 (19:25 -0800)]
doc/go1: more package updates
Everything there (as first draft) except the time package.

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

13 years agogc: implement == on structs and arrays
Russ Cox [Tue, 13 Dec 2011 03:22:09 +0000 (22:22 -0500)]
gc: implement == on structs and arrays

To allow these types as map keys, we must fill in
equal and hash functions in their algorithm tables.
Structs or arrays that are "just memory", like [2]int,
can and do continue to use the AMEM algorithm.
Structs or arrays that contain special values like
strings or interface values use generated functions
for both equal and hash.

The runtime helper func runtime.equal(t, x, y) bool handles
the general equality case for x == y and calls out to
the equal implementation in the algorithm table.

For short values (<= 4 struct fields or array elements),
the sequence of elementwise comparisons is inlined
instead of calling runtime.equal.

R=ken, mpimenov
CC=golang-dev
https://golang.org/cl/5451105

13 years agospec: allow comparison of structs, arrays containing comparable values
Russ Cox [Tue, 13 Dec 2011 03:21:46 +0000 (22:21 -0500)]
spec: allow comparison of structs, arrays containing comparable values

Also, clarify when interface comparison panics and
that comparison to nil is a special syntax rather than
a general comparison rule.

R=r, gri, r, iant, cw, bradfitz
CC=golang-dev
https://golang.org/cl/5440117

13 years agohtml: update comments to match latest spec.
Nigel Tao [Tue, 13 Dec 2011 03:20:26 +0000 (14:20 +1100)]
html: update comments to match latest spec.

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

13 years agohtml: a first step at parsing foreign content (MathML, SVG).
Nigel Tao [Tue, 13 Dec 2011 02:52:47 +0000 (13:52 +1100)]
html: a first step at parsing foreign content (MathML, SVG).

Nodes now have a Namespace field.

Pass adoption01.dat, test 12:
<a><svg><tr><input></a>

| <html>
|   <head>
|   <body>
|     <a>
|       <svg svg>
|         <svg tr>
|           <svg input>

The other adoption01.dat tests already passed.

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

13 years agosyscall: regenerate z-files for darwin, freebsd
Mikio Hara [Tue, 13 Dec 2011 01:27:23 +0000 (10:27 +0900)]
syscall: regenerate z-files for darwin, freebsd

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

13 years agonet: fix typo
Mikio Hara [Tue, 13 Dec 2011 01:12:45 +0000 (10:12 +0900)]
net: fix typo

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

13 years agoenv.bash: export CGO_ENABLED so cgo tests run
Alex Brainman [Mon, 12 Dec 2011 23:47:51 +0000 (10:47 +1100)]
env.bash: export CGO_ENABLED so cgo tests run

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

13 years agomisc/cgo/test: fix after latest time changes
Alex Brainman [Mon, 12 Dec 2011 23:46:58 +0000 (10:46 +1100)]
misc/cgo/test: fix after latest time changes

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

13 years agovarious: a grab-bag of time.Duration cleanups.
David Symonds [Mon, 12 Dec 2011 23:42:56 +0000 (10:42 +1100)]
various: a grab-bag of time.Duration cleanups.

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

13 years agotime: allow sleep tests to run for 200% too long
Russ Cox [Mon, 12 Dec 2011 23:33:47 +0000 (18:33 -0500)]
time: allow sleep tests to run for 200% too long

Some VMs are slow.  Very slow.
Fixes #2421.

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

13 years agocompress/flate: fix out of bounds error
Ivan Krasin [Mon, 12 Dec 2011 23:25:32 +0000 (18:25 -0500)]
compress/flate: fix out of bounds error

Fixes #2508.

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

13 years agoruntime: Changes to the runtime to support NetBSD.
Christopher Nielsen [Mon, 12 Dec 2011 23:10:11 +0000 (18:10 -0500)]
runtime: Changes to the runtime to support NetBSD.

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

13 years agogodoc: added an opensearch description document.
Christoph Hack [Mon, 12 Dec 2011 23:01:06 +0000 (18:01 -0500)]
godoc: added an opensearch description document.

R=golang-dev, r, tux21b, rsc
CC=golang-dev
https://golang.org/cl/5479062

13 years agoA+C: add Christoph Hack (individual CLA)
Russ Cox [Mon, 12 Dec 2011 23:01:02 +0000 (18:01 -0500)]
A+C: add Christoph Hack (individual CLA)

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

13 years agodoc: add Error Handling article
Andrew Gerrand [Mon, 12 Dec 2011 22:44:06 +0000 (09:44 +1100)]
doc: add Error Handling article

Originally published on The Go Programming Language Blog, July 12, 2011.

http://blog.golang.org/2011/07/error-handling-and-go.html

Update #2547

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

13 years agosql: fix missing mutex unlock in an error case
Brad Fitzpatrick [Mon, 12 Dec 2011 21:56:56 +0000 (13:56 -0800)]
sql: fix missing mutex unlock in an error case

Fixes #2542

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

13 years agoreflect: fix Slice cap
Gustavo Niemeyer [Mon, 12 Dec 2011 21:45:40 +0000 (19:45 -0200)]
reflect: fix Slice cap

R=golang-dev, dsymonds, r, rsc
CC=golang-dev
https://golang.org/cl/5483044

13 years agoruntime: madvise and SysUnused for Linux
Sébastien Paolacci [Mon, 12 Dec 2011 21:33:13 +0000 (16:33 -0500)]
runtime: madvise and SysUnused for Linux

SysUnused being a direct call to madvise MADV_DONTNEED.

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

13 years agogc: avoid 0-length C array
Lucio De Re [Mon, 12 Dec 2011 21:25:31 +0000 (16:25 -0500)]
gc: avoid 0-length C array

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

13 years agoos: fix Plan 9 build for new FileInfo API
Anthony Martin [Mon, 12 Dec 2011 21:14:00 +0000 (16:14 -0500)]
os: fix Plan 9 build for new FileInfo API

R=lucio.dere, rsc
CC=golang-dev
https://golang.org/cl/5440073

13 years agotime: fix Plan 9 build for new API
Anthony Martin [Mon, 12 Dec 2011 21:12:22 +0000 (16:12 -0500)]
time: fix Plan 9 build for new API

I had to move readFile into sys_$GOOS.go
since syscall.Open takes only two arguments
on Plan 9.

R=lucio.dere, rsc, alex.brainman
CC=golang-dev
https://golang.org/cl/5447061

13 years agogc: fix wrong arguments to error message for switches.
Rémy Oudompheng [Mon, 12 Dec 2011 21:08:32 +0000 (16:08 -0500)]
gc: fix wrong arguments to error message for switches.

Fixes #2502.

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

13 years agotime: gob marshaler for Time
Robert Hencke [Mon, 12 Dec 2011 21:08:29 +0000 (16:08 -0500)]
time: gob marshaler for Time

Addresses issue 2526

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

13 years agomath: fix special cases in Nextafter
Charles L. Dorian [Mon, 12 Dec 2011 20:51:11 +0000 (15:51 -0500)]
math: fix special cases in Nextafter

Nextafter(0, -1) != -0.

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

13 years agold/6l/8l: First pass at changes to the linker to support NetBSD binaries.
Christopher Nielsen [Mon, 12 Dec 2011 20:42:11 +0000 (15:42 -0500)]
ld/6l/8l: First pass at changes to the linker to support NetBSD binaries.

This will not currently create valid NetBSD binaries because NetBSD requires
an ELF note section to run, otherwise the kernel will throw ENOEXEC. I was
unable to determine an elegant way to add the section, so I am submitting
what I have.

References:
http://www.netbsd.org/docs/kernel/elf-notes.html
http://mail-index.netbsd.org/netbsd-bugs/2001/08/03/0012.html

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

13 years agobuild: Changes to the build infrastructure for NetBSD.
Christopher Nielsen [Mon, 12 Dec 2011 20:42:06 +0000 (15:42 -0500)]
build: Changes to the build infrastructure for NetBSD.

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

13 years agogc: add varargck for %lN
Lucio De Re [Mon, 12 Dec 2011 20:42:02 +0000 (15:42 -0500)]
gc: add varargck for %lN

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

13 years agogc: allow colon in //line file name
Russ Cox [Mon, 12 Dec 2011 20:41:54 +0000 (15:41 -0500)]
gc: allow colon in //line file name

Assume last colon introduces line number.

Fixes #2543.

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

13 years agodoc/go1: the simpler package changes
Rob Pike [Mon, 12 Dec 2011 20:26:56 +0000 (12:26 -0800)]
doc/go1: the simpler package changes

R=golang-dev, fullung, dsymonds, r, adg
CC=golang-dev
https://golang.org/cl/5477056

13 years agoarchive/zip: make zip understand os.FileMode.
Roger Peppe [Mon, 12 Dec 2011 20:22:55 +0000 (15:22 -0500)]
archive/zip: make zip understand os.FileMode.
Fixes implicit dependency on underlying os file modes.

R=rsc, r, n13m3y3r, gustavo, adg
CC=golang-dev
https://golang.org/cl/5440130

13 years agonet/http: make test remove temporary file and directory
Ian Lance Taylor [Mon, 12 Dec 2011 18:40:15 +0000 (10:40 -0800)]
net/http: make test remove temporary file and directory

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

13 years agocrypto/aes: Made faster by eliminating some indirection
Taru Karttunen [Mon, 12 Dec 2011 14:58:04 +0000 (09:58 -0500)]
crypto/aes: Made faster by eliminating some indirection

Made te and td arrays into variables te0-3 and td0-3,
which improves performance from 7000ns/op to 5800.

R=rsc, rogpeppe, agl
CC=golang-dev
https://golang.org/cl/5449077

13 years agodoc: remove file.go from run (fix windows build)
Andrew Gerrand [Mon, 12 Dec 2011 05:14:38 +0000 (16:14 +1100)]
doc: remove file.go from run (fix windows build)

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

13 years agodoc/go_tutorial: make clear the file example is Unix-specific
Rob Pike [Mon, 12 Dec 2011 05:03:49 +0000 (21:03 -0800)]
doc/go_tutorial: make clear the file example is Unix-specific
Fixes #2553.

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

13 years agohtml: don't ignore whitespace in or after framesets
Andrew Balholm [Mon, 12 Dec 2011 02:18:01 +0000 (13:18 +1100)]
html: don't ignore whitespace in or after framesets

Pass tests6.dat, test 7:
<frameset></frameset>
foo

| <html>
|   <head>
|   <frameset>
|   "
"

Also pass tests through test 12:
<form><form>

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

13 years agodoc: add Defer, Panic, and Recover article
Andrew Gerrand [Mon, 12 Dec 2011 02:15:29 +0000 (13:15 +1100)]
doc: add Defer, Panic, and Recover article

Originally published on The Go Programming Language Blog, August 4 2010.

http://blog.golang.org/2010/08/defer-panic-and-recover.html

Update #2547

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

13 years agonet/http: further simplify example program
Rob Pike [Sun, 11 Dec 2011 17:29:44 +0000 (09:29 -0800)]
net/http: further simplify example program
(should have caught this in review.)

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

13 years agoexp/norm: fix rune/int types in test
Joel Sing [Sun, 11 Dec 2011 17:25:09 +0000 (09:25 -0800)]
exp/norm: fix rune/int types in test

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

13 years agoHousekeeping: Cleaning up the clean-up process.
Lucio De Re [Sun, 11 Dec 2011 17:23:17 +0000 (09:23 -0800)]
Housekeeping: Cleaning up the clean-up process.

src/clean.bash:
        Add clean-ups for previously overlooked directories.
doc/codelab/wiki/Makefile:
        Dropped "index.html" from CLEANFILES so it will not be
        deleted on cleaning.

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

13 years agopkg/runtime/Makefile: sorted object module names.
Lucio De Re [Sun, 11 Dec 2011 17:21:53 +0000 (09:21 -0800)]
pkg/runtime/Makefile: sorted object module names.

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

13 years agonet/http: fix trivial example server
Olivier Duperray [Sun, 11 Dec 2011 17:11:57 +0000 (09:11 -0800)]
net/http: fix trivial example server

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

13 years agogotest: use build.ArchChar()
Robert Hencke [Sat, 10 Dec 2011 22:42:29 +0000 (14:42 -0800)]
gotest: use build.ArchChar()

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

13 years agotime: fix Time.Add
Hector Chu [Sat, 10 Dec 2011 21:55:38 +0000 (21:55 +0000)]
time: fix Time.Add

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

13 years agospec: adjust complex constant example
Robert Hencke [Sat, 10 Dec 2011 18:04:33 +0000 (10:04 -0800)]
spec: adjust complex constant example

Fixes https://golang.org/cl/5444053/#msg41

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

13 years agopkg: adjust "the a" in comments
Robert Hencke [Sat, 10 Dec 2011 02:02:23 +0000 (13:02 +1100)]
pkg: adjust "the a" in comments

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

13 years agoexpvar: fix typo in Publish documentation
Rob Pike [Fri, 9 Dec 2011 22:24:51 +0000 (14:24 -0800)]
expvar: fix typo in Publish documentation
Found and fixed by bketelsen@gmail.com.
Not worth making him a CONTRIBUTOR to delete one character.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5476054

13 years agodoc/go1: syscalls, strconv
Rob Pike [Fri, 9 Dec 2011 22:12:51 +0000 (14:12 -0800)]
doc/go1: syscalls, strconv

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

13 years agogc: 0 expected bugs
Russ Cox [Fri, 9 Dec 2011 19:58:28 +0000 (14:58 -0500)]
gc: 0 expected bugs

Now that Luuk's qualified exporting code
is in, fixing this bug is trivial.

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

13 years agohtml/template: make Must work
Rob Pike [Fri, 9 Dec 2011 18:47:36 +0000 (10:47 -0800)]
html/template: make Must work
Fixes #2545.

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

13 years agogc: fix another blank bug
Russ Cox [Fri, 9 Dec 2011 16:59:21 +0000 (11:59 -0500)]
gc: fix another blank bug

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

13 years agodoc/go1: the rest of the language changes
Rob Pike [Fri, 9 Dec 2011 16:31:57 +0000 (08:31 -0800)]
doc/go1: the rest of the language changes

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

13 years agotmpltohtml: feature for easier snippet extraction
Rob Pike [Fri, 9 Dec 2011 16:31:04 +0000 (08:31 -0800)]
tmpltohtml: feature for easier snippet extraction
Lines that end with OMIT are omitted from the output.
A comment such as
        // Example stops here. OMIT
can be used as a marker but not appear in the output.

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

13 years agogc: resolve built-ins to built-in symbol
Russ Cox [Fri, 9 Dec 2011 13:28:17 +0000 (08:28 -0500)]
gc: resolve built-ins to built-in symbol

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

13 years agogc: minor changes for inlining
Russ Cox [Fri, 9 Dec 2011 13:03:51 +0000 (08:03 -0500)]
gc: minor changes for inlining

Copied from 5400043 since they stand alone from inlining.

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

13 years agospec: examples of untyped boolean, string constants
Russ Cox [Fri, 9 Dec 2011 05:13:19 +0000 (00:13 -0500)]
spec: examples of untyped boolean, string constants

This is a spec correction, not a language change.
The implementations have behaved like this for years
(and there are tests to that effect), and elsewhere in
the spec true and false are defined to be untyped
boolean constants.

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

13 years agospec: remove redundant, outdated definition of default literal types
Russ Cox [Fri, 9 Dec 2011 05:12:49 +0000 (00:12 -0500)]
spec: remove redundant, outdated definition of default literal types

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

13 years agogc: rune is now an alias for int32
Russ Cox [Fri, 9 Dec 2011 05:12:07 +0000 (00:12 -0500)]
gc: rune is now an alias for int32

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

13 years agospec: rune is now an alias for int32
Russ Cox [Fri, 9 Dec 2011 05:11:43 +0000 (00:11 -0500)]
spec: rune is now an alias for int32

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

13 years agoexp/types: fix linux build
Russ Cox [Fri, 9 Dec 2011 04:20:21 +0000 (23:20 -0500)]
exp/types: fix linux build

I don't understand why it was only broken on Linux

TBR=gri
CC=golang-dev
https://golang.org/cl/5479045

13 years agogc: fix export of '\'' and '\\' constants
Russ Cox [Fri, 9 Dec 2011 03:43:31 +0000 (22:43 -0500)]
gc: fix export of '\'' and '\\' constants

Fixes Windows build.

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

13 years agospec: fix typo in example comment
Charles L. Dorian [Fri, 9 Dec 2011 03:27:14 +0000 (22:27 -0500)]
spec: fix typo in example comment

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

13 years agoupdate tree for new default type rule
Russ Cox [Fri, 9 Dec 2011 03:08:03 +0000 (22:08 -0500)]
update tree for new default type rule

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

13 years agogc: implement character constant type rules
Russ Cox [Fri, 9 Dec 2011 03:07:43 +0000 (22:07 -0500)]
gc: implement character constant type rules

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

13 years agomath: special cases for Pow10; delete BUG
Charles L. Dorian [Fri, 9 Dec 2011 03:06:33 +0000 (22:06 -0500)]
math: special cases for Pow10; delete BUG

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

13 years agospec: var x = 'a' defaults to type rune
Russ Cox [Fri, 9 Dec 2011 02:48:19 +0000 (21:48 -0500)]
spec: var x = 'a' defaults to type rune

R=gri, r, r, adg, iant, ken
CC=golang-dev
https://golang.org/cl/5444053

13 years agodoc/go1: most of the simple language changes
Rob Pike [Fri, 9 Dec 2011 00:39:05 +0000 (16:39 -0800)]
doc/go1: most of the simple language changes

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

13 years agosyscall: allow for mksyscall_windows.pl to be used outside of syscall
Alex Brainman [Fri, 9 Dec 2011 00:12:03 +0000 (11:12 +1100)]
syscall: allow for mksyscall_windows.pl to be used outside of syscall

this change should have been part of fafcd328da73

R=golang-dev, bsiegert
CC=golang-dev
https://golang.org/cl/5462045

13 years agomisc/cgo/testso: do not leave out file behind
Alex Brainman [Fri, 9 Dec 2011 00:00:49 +0000 (11:00 +1100)]
misc/cgo/testso: do not leave out file behind

R=golang-dev, dvyukov
CC=golang-dev
https://golang.org/cl/5461044

13 years agosyscall: Remove obsolete Errstr call from commented-out example.
Benny Siegert [Thu, 8 Dec 2011 23:42:34 +0000 (10:42 +1100)]
syscall: Remove obsolete Errstr call from commented-out example.

syscall_windows.go contains a small demo, which calls the obsolete
syscall.Errstr function.

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

13 years agomath: document more special cases
Charles L. Dorian [Thu, 8 Dec 2011 22:07:13 +0000 (17:07 -0500)]
math: document more special cases

Acosh, Asinh, Atanh, Ceil, Floor, Trunc, Mod and Remainder affected. These changes add some non-finite arguments and results (and -0.0 results).

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

13 years agocrypto/dsa: don't truncate input hashes.
Adam Langley [Thu, 8 Dec 2011 21:46:19 +0000 (16:46 -0500)]
crypto/dsa: don't truncate input hashes.

Although FIPS 186-3 says that we should truncate the hashes, at least
one other library (libgcrypt) doesn't. This means that it's impossible
to interoperate with code using gcrypt if we enforce the truncation
inside of crypto/dsa.

This change shouldn't actually affect anything because nearly
everybody pairs DSA with SHA1, which doesn't need to be truncated in
either case.

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

13 years agodoc/go1: document rearranged package hierarchy
Rob Pike [Thu, 8 Dec 2011 19:35:28 +0000 (11:35 -0800)]
doc/go1: document rearranged package hierarchy
Some exciting HTML and CSS here.

R=remyoudompheng, rsc, r
CC=golang-dev
https://golang.org/cl/5460047

13 years agotmpltohtml: put a DO NOT EDIT mark automatically in the output
Rob Pike [Thu, 8 Dec 2011 19:26:49 +0000 (11:26 -0800)]
tmpltohtml: put a DO NOT EDIT mark automatically in the output

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

13 years agohtml/template: clean up locking for ExecuteTemplate
Rob Pike [Thu, 8 Dec 2011 18:15:53 +0000 (10:15 -0800)]
html/template: clean up locking for ExecuteTemplate

R=mikesamuel, rogpeppe
CC=golang-dev
https://golang.org/cl/5448137

13 years agosyscall: add constants for flock() system call under Linux.
Andrea Spadaccini [Thu, 8 Dec 2011 06:12:08 +0000 (15:12 +0900)]
syscall: add constants for flock() system call under Linux.

The values have been generated only for the i386 and amd64 architectures.

R=golang-dev, mikioh.mikioh, dsymonds
CC=bradfitz, dsymonds, golang-dev
https://golang.org/cl/5452060

13 years agoCONTRIBUTORS: Andrea Spadaccini (Google CLA)
David Symonds [Thu, 8 Dec 2011 05:53:39 +0000 (16:53 +1100)]
CONTRIBUTORS: Andrea Spadaccini (Google CLA)

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

13 years agotime: use Duration for AfterFunc.
David Symonds [Thu, 8 Dec 2011 04:42:44 +0000 (15:42 +1100)]
time: use Duration for AfterFunc.

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

13 years agogc: rename %union field name from lint to i
Russ Cox [Thu, 8 Dec 2011 04:38:32 +0000 (23:38 -0500)]
gc: rename %union field name from lint to i

#define lint has special meaning to Bison;
having a field named lint conflicts with that.

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

13 years agosyscall: return error, not uintptr, when function returns error
Alex Brainman [Thu, 8 Dec 2011 01:07:21 +0000 (12:07 +1100)]
syscall: return error, not uintptr, when function returns error

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

13 years agodoc/go1: map deletion
Rob Pike [Thu, 8 Dec 2011 00:11:17 +0000 (16:11 -0800)]
doc/go1: map deletion
This CL is in part a proposal for how to write these sections:
- Brief discussion of change
- No attempt to analyze the thinking about it
- Old code
- New code, runnable if possible
- How to update old programs

R=golang-dev, remyoudompheng, gri, adg
CC=golang-dev
https://golang.org/cl/5454044

13 years agogobuilder: goinstall packages after building go tree
Andrew Gerrand [Wed, 7 Dec 2011 23:31:06 +0000 (10:31 +1100)]
gobuilder: goinstall packages after building go tree

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

13 years agostrconv: fix documentation
Robert Griesemer [Wed, 7 Dec 2011 22:45:45 +0000 (14:45 -0800)]
strconv: fix documentation

Also: minor performance fix for large precision results.

benchmark                                   old ns/op    new ns/op    delta
strconv_test.BenchmarkFormatFloatDecimal         2734         2734   +0.00%
strconv_test.BenchmarkFormatFloat                3141         3139   -0.06%
strconv_test.BenchmarkFormatFloatExp             8970         8989   +0.21%
strconv_test.BenchmarkFormatFloatBig             3228         3208   -0.62%

Fixes #2535.

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

13 years agodoc: skeleton for release note document
Rob Pike [Wed, 7 Dec 2011 22:33:37 +0000 (14:33 -0800)]
doc: skeleton for release note document
No content yet other than titles and an introductory paragraph.
Once this is in, content can arise as separate manageable CLs.

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

13 years agogc: keep pointer to original node in constant rewrites.
Rémy Oudompheng [Wed, 7 Dec 2011 21:18:50 +0000 (16:18 -0500)]
gc: keep pointer to original node in constant rewrites.

This allows printing meaningful expressions in error messages
instead of evaluated constants.
Fixes #2276.

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

13 years agoexp/sql: simplify some string conversions.
David Symonds [Wed, 7 Dec 2011 21:08:00 +0000 (08:08 +1100)]
exp/sql: simplify some string conversions.

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

13 years agogc: fix spurious typecheck loop in &composite literal
Russ Cox [Wed, 7 Dec 2011 20:48:55 +0000 (15:48 -0500)]
gc: fix spurious typecheck loop in &composite literal

Fixes #2538.

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

13 years agobytes: lost edit from earlier CL
Russ Cox [Wed, 7 Dec 2011 20:30:01 +0000 (15:30 -0500)]
bytes: lost edit from earlier CL

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

13 years agobytes: faster Count, Index, Equal
Russ Cox [Wed, 7 Dec 2011 20:09:56 +0000 (15:09 -0500)]
bytes: faster Count, Index, Equal

Benchmarks are from GOARCH=amd64 on a MacPro5,1.

benchmark                                    old MB/s     new MB/s  speedup
bytes_test.BenchmarkEqual32                    452.89       891.07    1.97x
bytes_test.BenchmarkEqual4K                    852.71      1700.44    1.99x
bytes_test.BenchmarkEqual4M                    841.53      1587.93    1.89x
bytes_test.BenchmarkEqual64M                   838.22      1578.14    1.88x

bytes_test.BenchmarkIndex32                     58.02        48.99    0.84x
bytes_test.BenchmarkIndex4K                     48.26        41.32    0.86x
bytes_test.BenchmarkIndex4M                     48.20        41.24    0.86x
bytes_test.BenchmarkIndex64M                    48.08        41.21    0.86x
bytes_test.BenchmarkIndexEasy32                410.04       546.82    1.33x
bytes_test.BenchmarkIndexEasy4K                849.26     14257.37   16.79x
bytes_test.BenchmarkIndexEasy4M                854.54     17222.15   20.15x
bytes_test.BenchmarkIndexEasy64M               843.57     11060.40   13.11x

bytes_test.BenchmarkCount32                     57.24        50.68    0.89x
bytes_test.BenchmarkCount4K                     48.19        41.82    0.87x
bytes_test.BenchmarkCount4M                     48.18        41.74    0.87x
bytes_test.BenchmarkCount64M                    48.17        41.71    0.87x
bytes_test.BenchmarkCountEasy32                433.11       547.44    1.26x
bytes_test.BenchmarkCountEasy4K               1130.59     14194.06   12.55x
bytes_test.BenchmarkCountEasy4M               1131.23     17231.18   15.23x
bytes_test.BenchmarkCountEasy64M              1111.40     11068.88    9.96x

The non-easy Count/Index benchmarks are a worst case input.

regexp.BenchmarkMatchEasy0_32                  237.46       221.47    0.93x
regexp.BenchmarkMatchEasy0_1K                  553.53      1019.72    1.84x
regexp.BenchmarkMatchEasy0_32K                 693.99      1672.06    2.41x
regexp.BenchmarkMatchEasy0_1M                  688.72      1611.68    2.34x
regexp.BenchmarkMatchEasy0_32M                 680.70      1565.05    2.30x
regexp.BenchmarkMatchEasy1_32                  165.56       243.08    1.47x
regexp.BenchmarkMatchEasy1_1K                  336.45       496.32    1.48x
regexp.BenchmarkMatchEasy1_32K                 302.80       425.63    1.41x
regexp.BenchmarkMatchEasy1_1M                  300.42       414.20    1.38x
regexp.BenchmarkMatchEasy1_32M                 299.64       413.47    1.38x

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

13 years agoregexp: avoid allocation of input interface
Russ Cox [Wed, 7 Dec 2011 20:03:05 +0000 (15:03 -0500)]
regexp: avoid allocation of input interface

Matters most for small inputs, because there is no real work
to amortize the allocation effort against.

benchmark                                old ns/op    new ns/op    delta
BenchmarkLiteral                               613          473  -22.84%
BenchmarkNotLiteral                           4981         4931   -1.00%
BenchmarkMatchClass                           7289         7122   -2.29%
BenchmarkMatchClass_InRange                   6618         6663   +0.68%
BenchmarkReplaceAll                           7843         7233   -7.78%
BenchmarkAnchoredLiteralShortNonMatch          329          228  -30.70%
BenchmarkAnchoredLiteralLongNonMatch           322          228  -29.19%
BenchmarkAnchoredShortMatch                    838          715  -14.68%
BenchmarkAnchoredLongMatch                     824          715  -13.23%

benchmark                                 old MB/s     new MB/s  speedup
BenchmarkMatchEasy0_32                      119.73       196.61    1.64x
BenchmarkMatchEasy0_1K                      540.58       538.33    1.00x
BenchmarkMatchEasy0_32K                     732.57       714.00    0.97x
BenchmarkMatchEasy0_1M                      726.44       708.36    0.98x
BenchmarkMatchEasy0_32M                     707.77       691.45    0.98x
BenchmarkMatchEasy1_32                      102.12       136.11    1.33x
BenchmarkMatchEasy1_1K                      298.31       307.04    1.03x
BenchmarkMatchEasy1_32K                     273.56       274.43    1.00x
BenchmarkMatchEasy1_1M                      268.42       269.23    1.00x
BenchmarkMatchEasy1_32M                     266.15       267.34    1.00x
BenchmarkMatchMedium_32                       2.53         3.38    1.34x
BenchmarkMatchMedium_1K                       9.37         9.57    1.02x
BenchmarkMatchMedium_32K                      9.29         9.67    1.04x
BenchmarkMatchMedium_1M                       9.42         9.66    1.03x
BenchmarkMatchMedium_32M                      9.41         9.62    1.02x
BenchmarkMatchHard_32                         6.66         6.75    1.01x
BenchmarkMatchHard_1K                         6.81         6.85    1.01x
BenchmarkMatchHard_32K                        6.79         6.85    1.01x
BenchmarkMatchHard_1M                         6.82         6.83    1.00x
BenchmarkMatchHard_32M                        6.80         6.80    1.00x

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

13 years agotest: make array smaller in nilptr test
Russ Cox [Wed, 7 Dec 2011 20:00:44 +0000 (15:00 -0500)]
test: make array smaller in nilptr test

Fixes #2314.

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

13 years agogodoc: <pre> must not occur inside <p>
Olivier Duperray [Wed, 7 Dec 2011 20:00:38 +0000 (15:00 -0500)]
godoc: <pre> must not occur inside <p>
Fixes #2532

R=golang-dev, dr.volker.dobler, rsc
CC=golang-dev
https://golang.org/cl/5450115

13 years agoA+C: Olivier Duperray, Taru Karttunen (individual CLA)
Russ Cox [Wed, 7 Dec 2011 20:00:32 +0000 (15:00 -0500)]
A+C: Olivier Duperray, Taru Karttunen (individual CLA)

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