]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agoruntime: fix build
Russ Cox [Fri, 16 Dec 2011 22:58:53 +0000 (17:58 -0500)]
runtime: fix build

I am looking forward to not supporting two build
systems simultaneously.  Make complains about
a circular dependency still, but I don't understand it
and it's probably not worth the time to figure out.

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

13 years agowebsocket: fix a trivial example server
Olivier Duperray [Fri, 16 Dec 2011 22:24:37 +0000 (14:24 -0800)]
websocket: fix a trivial example server

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

13 years agoruntime: separate out auto-generated files
Russ Cox [Fri, 16 Dec 2011 22:04:32 +0000 (17:04 -0500)]
runtime: separate out auto-generated files

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

13 years agoruntime: fix build
Russ Cox [Fri, 16 Dec 2011 20:46:25 +0000 (15:46 -0500)]
runtime: fix build

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

13 years agoruntime: make more build-friendly
Russ Cox [Fri, 16 Dec 2011 20:33:58 +0000 (15:33 -0500)]
runtime: make more build-friendly

Collapse the arch,os-specific directories into the main directory
by renaming xxx/foo.c to foo_xxx.c, and so on.

There are no substantial edits here, except to the Makefile.
The assumption is that the Go tool will #define GOOS_darwin
and GOARCH_amd64 and will make any file named something
like signals_darwin.h available as signals_GOOS.h during the
build.  This replaces what used to be done with -I$(GOOS).

There is still work to be done to make runtime build with
standard tools, but this is a big step.  After this we will have
to write a script to generate all the generated files so they
can be checked in (instead of generated during the build).

R=r, iant, r, lucio.dere
CC=golang-dev
https://golang.org/cl/5490053

13 years agoencoding/gob: arrays are zero only if their elements are zero
Rob Pike [Fri, 16 Dec 2011 19:52:58 +0000 (11:52 -0800)]
encoding/gob: arrays are zero only if their elements are zero

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

13 years agogob: isZero for struct values
Rob Pike [Fri, 16 Dec 2011 19:33:57 +0000 (11:33 -0800)]
gob: isZero for struct values
Fixes #2577.

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

13 years agovarious: use $GCFLAGS and $GCIMPORTS like Make does
Maxim Pimenov [Fri, 16 Dec 2011 16:31:39 +0000 (11:31 -0500)]
various: use $GCFLAGS and $GCIMPORTS like Make does

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

13 years agonet/http: Added interface for a cookie jar.
Volker Dobler [Fri, 16 Dec 2011 15:48:41 +0000 (10:48 -0500)]
net/http: Added interface for a cookie jar.

Types implementing CookieJar may be used in a Client
to persist cookies.

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

13 years agocodereview: Initialize "found" in codereview.py.
Miki Tebeka [Fri, 16 Dec 2011 15:39:20 +0000 (10:39 -0500)]
codereview: Initialize "found" in codereview.py.

Fixes #2569 (hg undo crashes when CL not found).

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

13 years agosyscall: sort Makefile, mkall.sh and mkerrors.sh entries
Mikio Hara [Fri, 16 Dec 2011 10:51:25 +0000 (19:51 +0900)]
syscall: sort Makefile, mkall.sh and mkerrors.sh entries

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

13 years agonet: sort Makefile entries
Mikio Hara [Fri, 16 Dec 2011 10:50:55 +0000 (19:50 +0900)]
net: sort Makefile entries

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

13 years agogo/build: make sure syslist.go is gofmted
Alex Brainman [Fri, 16 Dec 2011 04:52:30 +0000 (15:52 +1100)]
go/build: make sure syslist.go is gofmted

R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5490051

13 years agogo: implement test command
Russ Cox [Fri, 16 Dec 2011 04:51:04 +0000 (23:51 -0500)]
go: implement test command

Gotest tries to build things, for which it invokes make,
and it was too hard to coordinate go invoking gotest
invoking go to build the test binary, so put all the code
here instead.  Gotest will be deleted once we switch.

The only code that really made sense to copy verbatim
was the flag parsing.

This remains a work in progress.  There are still plenty
of things to clean up and make better, but this is a good
checkpoint.  It can run all the tests in the tree (except
runtime, which it can't build yet).

$ go test all -short
ok   archive/tar
ok   archive/zip
ok   bufio
?    builtin [no test files]
ok   bytes
ok   compress/bzip2
ok   compress/flate
ok   compress/gzip
ok   compress/lzw
ok   compress/zlib
ok   container/heap
ok   container/list
ok   container/ring
?    crypto [no test files]
ok   crypto/aes
ok   crypto/bcrypt
ok   crypto/blowfish
ok   crypto/cast5
ok   crypto/cipher
ok   crypto/des
ok   crypto/dsa
ok   crypto/ecdsa
ok   crypto/elliptic
ok   crypto/hmac
ok   crypto/md4
ok   crypto/md5
ok   crypto/ocsp
ok   crypto/openpgp
ok   crypto/openpgp/armor
ok   crypto/openpgp/elgamal
?    crypto/openpgp/error [no test files]
ok   crypto/openpgp/packet
ok   crypto/openpgp/s2k
ok   crypto/rand
ok   crypto/rc4
ok   crypto/ripemd160
ok   crypto/rsa
ok   crypto/sha1
ok   crypto/sha256
ok   crypto/sha512
ok   crypto/subtle
ok   crypto/tls
ok   crypto/twofish
ok   crypto/x509
?    crypto/x509/pkix [no test files]
ok   crypto/xtea
ok   debug/dwarf
ok   debug/elf
ok   debug/gosym
ok   debug/macho
ok   debug/pe
ok   encoding/ascii85
ok   encoding/asn1
ok   encoding/base32
ok   encoding/base64
ok   encoding/binary
ok   encoding/csv
ok   encoding/git85
ok   encoding/gob
ok   encoding/hex
ok   encoding/json
ok   encoding/pem
ok   encoding/xml
ok   errors
ok   exp/ebnf
?    exp/ebnflint [no test files]
ok   exp/gotype
ok   exp/norm
ok   exp/spdy
ok   exp/sql
ok   exp/sql/driver
ok   exp/ssh
ok   exp/types
ok   expvar
ok   flag
ok   fmt
ok   go/ast
ok   go/build
ok   go/doc
ok   go/parser
ok   go/printer
ok   go/scanner
ok   go/token
?    hash [no test files]
ok   hash/adler32
ok   hash/crc32
ok   hash/crc64
ok   hash/fnv
ok   html
ok   html/template
ok   image
?    image/bmp [no test files]
?    image/color [no test files]
ok   image/draw
?    image/gif [no test files]
ok   image/jpeg
ok   image/png
ok   image/tiff
ok   image/ycbcr
ok   index/suffixarray
ok   io
ok   io/ioutil
ok   log
ok   log/syslog
ok   math
ok   math/big
ok   math/cmplx
ok   math/rand
ok   mime
ok   mime/multipart
ok   net
?    net/dict [no test files]
ok   net/http
ok   net/http/cgi
ok   net/http/fcgi
?    net/http/httptest [no test files]
ok   net/http/httputil
?    net/http/pprof [no test files]
ok   net/mail
ok   net/rpc
ok   net/rpc/jsonrpc
ok   net/smtp
ok   net/textproto
ok   net/url
ok   old/netchan
ok   old/regexp
ok   old/template
ok   os
ok   os/exec
ok   os/signal
ok   os/user
ok   patch
ok   path
ok   path/filepath
ok   reflect
ok   regexp
ok   regexp/syntax
# cd /Users/rsc/g/go/src/pkg/runtime; 6g -o /var/folders/mw/qfnx8hhd1_s9mm9wtbng0hw80000gn/T/go-build874847916/runtime_test/_obj/_go_.6 -p runtime_test -I /var/folders/mw/qfnx8hhd1_s9mm9wtbng0hw80000gn/T/go-build874847916 append_test.go chan_test.go closure_test.go gc_test.go mfinal_test.go proc_test.go sema_test.go softfloat64_test.go symtab_test.go
proc_test.go:87: undefined: runtime.Entersyscall
proc_test.go:88: undefined: runtime.Exitsyscall
proc_test.go:111: undefined: runtime.Entersyscall
proc_test.go:116: undefined: runtime.Exitsyscall
softfloat64_test.go:79: undefined: Fadd64
softfloat64_test.go:80: undefined: Fsub64
softfloat64_test.go:82: undefined: Fmul64
softfloat64_test.go:83: undefined: Fdiv64
softfloat64_test.go:94: undefined: F64to32
softfloat64_test.go:99: undefined: F32to64
softfloat64_test.go:99: too many errors

exit status 1
FAIL runtime [build failed]
?    runtime/cgo [no test files]
ok   runtime/debug
ok   runtime/pprof
ok   sort
ok   strconv
ok   strings
ok   sync
ok   sync/atomic
?    syscall [no test files]
?    testing [no test files]
?    testing/iotest [no test files]
ok   testing/quick
ok   testing/script
ok   text/scanner
ok   text/tabwriter
ok   text/template
ok   text/template/parse
ok   time
ok   unicode
ok   unicode/utf16
ok   unicode/utf8
?    unsafe [no test files]
ok   websocket
$

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

13 years agodashboard: improve key panic message
Andrew Gerrand [Fri, 16 Dec 2011 03:59:50 +0000 (14:59 +1100)]
dashboard: improve key panic message

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

13 years agoio/ioutil: remove another reference to _test
Russ Cox [Fri, 16 Dec 2011 00:32:47 +0000 (19:32 -0500)]
io/ioutil: remove another reference to _test

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

13 years agomisc/dashboard: user interface
Andrew Gerrand [Thu, 15 Dec 2011 23:48:06 +0000 (10:48 +1100)]
misc/dashboard: user interface

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

13 years agocrypto/tls: quiet build
Russ Cox [Thu, 15 Dec 2011 23:37:31 +0000 (18:37 -0500)]
crypto/tls: quiet build

On a Mac, all the useful functions are deprecated.

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

13 years agold: allow for IMAGE_REL_AMD64_ADDR32NB relocation type
Alex Brainman [Thu, 15 Dec 2011 23:32:14 +0000 (10:32 +1100)]
ld: allow for IMAGE_REL_AMD64_ADDR32NB relocation type

enable cgo again on windows/amd64

R=rsc, vcc.163
CC=golang-dev
https://golang.org/cl/5488074

13 years agoos/exec: fix -test.run argument for new 'go test'
Russ Cox [Thu, 15 Dec 2011 23:21:38 +0000 (18:21 -0500)]
os/exec: fix -test.run argument for new 'go test'

In 'go test' I deleted the leading package. prefix
from all the test names, since it contained no actual
information.  Adjust the -test.run argument accordingly.
This will still work with the current gotest too, since
the argument is an unanchored pattern.

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

13 years agoio/ioutil, old/template: do not assume _test exists for scratch space
Russ Cox [Thu, 15 Dec 2011 23:21:29 +0000 (18:21 -0500)]
io/ioutil, old/template: do not assume _test exists for scratch space

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

13 years agogovet: add checking for printf verbs
Rob Pike [Thu, 15 Dec 2011 23:17:52 +0000 (15:17 -0800)]
govet: add checking for printf verbs
Also fix the errors it catches.

Fixes #1654.

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

13 years agogodoc: Allow examples for methods.
Volker Dobler [Thu, 15 Dec 2011 23:01:54 +0000 (10:01 +1100)]
godoc: Allow examples for methods.

An example for a method M() of type T can be written as
func ExampleT_M() { ... }.
To differentiate between multiple examples for one function, type or
method a suffix with a lowercase start may be appended to the name
of the example function, e.g. ExampleFoo_basicUsage.

Fixes #2465.

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

13 years agotesting: trim spaces before comparing example output
Andrew Gerrand [Thu, 15 Dec 2011 22:43:58 +0000 (09:43 +1100)]
testing: trim spaces before comparing example output
bytes: add two Buffer examples

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

13 years agohtml: handle end tags in foreign objects.
Nigel Tao [Thu, 15 Dec 2011 22:36:50 +0000 (09:36 +1100)]
html: handle end tags in foreign objects.

I'm not 100% sure I get all the corner cases right, for end tags, but
I'll let the test suite smoke it out.

Pass tests10.dat, test 1:
<!DOCTYPE html><svg></svg><![CDATA[a]]>

| <!DOCTYPE html>
| <html>
|   <head>
|   <body>
|     <svg svg>
|     <!-- [CDATA[a]] -->

Also pass tests through test 5:
<!DOCTYPE html><body><table><svg></svg></table>

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

13 years agogo/printer, gofmt: don't write too many newlines
Robert Griesemer [Thu, 15 Dec 2011 21:51:47 +0000 (13:51 -0800)]
go/printer, gofmt: don't write too many newlines

In some rare cases, gofmt would accept more than the maximum
number of empty lines (1) between source code snippets.

The actual change is in printer.go, lines 773-775; the rest
is some minor restructuring.

Applied gofmt -w src misc .

Fixes #2387.

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

13 years agoexp/ssh: simplify Stdin/out/errPipe methods
Dave Cheney [Thu, 15 Dec 2011 21:50:41 +0000 (16:50 -0500)]
exp/ssh: simplify Stdin/out/errPipe methods

If a Pipe method is called, return the underlying
reader/writer from session.clientChan, bypassing the
io.Copy and io.Pipe harness.

StdoutPipe and StderrPipe now return an io.Reader not
an io.ReadCloser as SSH cannot signal the close of the
local reader to the remote process.

R=rsc, agl, gustav.paul, cw
CC=golang-dev
https://golang.org/cl/5493047

13 years agogovet: divide the program into one file per vetting suite
Rob Pike [Thu, 15 Dec 2011 21:44:35 +0000 (13:44 -0800)]
govet: divide the program into one file per vetting suite
Just a rearrangement except for a couple of new functions
and names so govet.go can have all the generic walk routines.

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

13 years agofmt: speed up floating point print, clean up some code
Rob Pike [Thu, 15 Dec 2011 20:52:29 +0000 (12:52 -0800)]
fmt: speed up floating point print, clean up some code
%g down to two mallocs from four. Also a mild speedup.

fmt_test.BenchmarkSprintfFloat         3016         2703  -10.38%

Fixes #2557.

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

13 years agojson: use strconv.Append variants to avoid allocations in encoding
Brad Fitzpatrick [Thu, 15 Dec 2011 19:21:21 +0000 (11:21 -0800)]
json: use strconv.Append variants to avoid allocations in encoding

Before/after, best of 3:
json.BenchmarkCodeEncoder  10  183495300 ns/op  10.58 MB/s
->
json.BenchmarkCodeEncoder  10  133025100 ns/op  14.59 MB/s

But don't get too excited about this.  These benchmarks, while
stable at any point of time, fluctuate wildly with any line of
code added or removed anywhere in the path due to stack splitting
issues.

It's currently much faster, though, and this is the API that
doesn't allocate so should always be faster in theory.

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

13 years agogo: help messages for 'go test'
Russ Cox [Thu, 15 Dec 2011 18:54:19 +0000 (13:54 -0500)]
go: help messages for 'go test'

The plan is to make 'go test' replace gotest entirely, so it
cannot refer to gotest's godoc.  Instead, copy gotest's
documentation in as three different help messages:
'go help test', 'go help testflag', and 'go help testfunc'.

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

13 years agogo spec: be precise about newlines
Robert Griesemer [Thu, 15 Dec 2011 18:51:51 +0000 (10:51 -0800)]
go spec: be precise about newlines

Several places mentioned tokens spanning "multiple lines"
which is not a well-defined term in the spec; newline is.

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

13 years agogo/scanner: strip CRs from raw literals
Robert Griesemer [Thu, 15 Dec 2011 18:51:32 +0000 (10:51 -0800)]
go/scanner: strip CRs from raw literals

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

13 years agomore tags for go/build
Russ Cox [Thu, 15 Dec 2011 18:35:59 +0000 (13:35 -0500)]
more tags for go/build

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

13 years agosql: add Rows.Columns
Brad Fitzpatrick [Thu, 15 Dec 2011 18:14:57 +0000 (10:14 -0800)]
sql: add Rows.Columns

Also, fix package name in error messages.

Fixes #2453

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

13 years agojson: some tests to demonstrate bad error messages
Brad Fitzpatrick [Thu, 15 Dec 2011 18:02:47 +0000 (10:02 -0800)]
json: some tests to demonstrate bad error messages

Not a fix yet (help wanted), but part of Issue 2331

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

13 years agoos: make compatible with go/build
Russ Cox [Thu, 15 Dec 2011 17:33:36 +0000 (12:33 -0500)]
os: make compatible with go/build

It is probably a mistake to have these here at all -
os is supposed to be portable - but this only fixes
the build issue.

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

13 years agotest/bench/go1: first draft of Go 1 benchmark suite
Russ Cox [Thu, 15 Dec 2011 17:32:59 +0000 (12:32 -0500)]
test/bench/go1: first draft of Go 1 benchmark suite

I have included a few important microbenchmarks,
but the overall intent is to have mostly end-to-end
benchmarks timing real world operations.

The jsondata.go file is a summary of agl's
activity in various open source repositories.
It gets used as test data for many of the benchmarks.

Everything links into one binary (even the test data)
so that it is easy to run the benchmarks on many
computers: there is just one file to copy around.

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

13 years agoos: OS-dependent bits to support NetBSD.
Christopher Nielsen [Thu, 15 Dec 2011 17:19:19 +0000 (12:19 -0500)]
os: OS-dependent bits to support NetBSD.

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

13 years agogc: inlining, allow empty bodies, fix _ arguments.
Luuk van Dijk [Thu, 15 Dec 2011 16:50:59 +0000 (17:50 +0100)]
gc: inlining, allow empty bodies, fix _ arguments.

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

13 years agogc: omit argument names from function types in error messages
Luuk van Dijk [Thu, 15 Dec 2011 16:38:47 +0000 (17:38 +0100)]
gc: omit argument names from function types in error messages

Fixes #2563

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

13 years agogc: better loopdepth analysis for labels
Luuk van Dijk [Thu, 15 Dec 2011 16:35:59 +0000 (17:35 +0100)]
gc: better loopdepth analysis for labels

This avoids degraded performance caused by extra labels
emitted by inlining (breaking strconv ftoa alloc count unittest) and is better in any case.

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

13 years agotime: new AddDate method
Roger Peppe [Thu, 15 Dec 2011 16:23:01 +0000 (11:23 -0500)]
time: new AddDate method

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

13 years agoexp/ssh: rename ClientAuthPublicKey helper ClientAuthKeyring
Dave Cheney [Thu, 15 Dec 2011 16:06:10 +0000 (11:06 -0500)]
exp/ssh: rename ClientAuthPublicKey helper ClientAuthKeyring

Also, rename ServerConfig.PubKeyCallback to PublicKeyCallback.

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

13 years agogc: implement and test \r in raw strings
Russ Cox [Thu, 15 Dec 2011 15:47:09 +0000 (10:47 -0500)]
gc: implement and test \r in raw strings

For issue 680.

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

13 years agodoc: remove an errant dot.
Andrew Gerrand [Thu, 15 Dec 2011 06:17:39 +0000 (17:17 +1100)]
doc: remove an errant dot.

Curses!

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

13 years agotag weekly.2011-12-14
Andrew Gerrand [Thu, 15 Dec 2011 05:57:28 +0000 (16:57 +1100)]
tag weekly.2011-12-14

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

13 years agoweekly.2011-12-14 weekly.2011-12-14
Andrew Gerrand [Thu, 15 Dec 2011 05:56:12 +0000 (16:56 +1100)]
weekly.2011-12-14

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

13 years agospec: skip carriage returns in raw literals
Rob Pike [Thu, 15 Dec 2011 05:52:41 +0000 (21:52 -0800)]
spec: skip carriage returns in raw literals

This change guarantees that whether the line ending convention
when the source is created includes carriage returns is irrelevant
to the value of the string. See issue 680.

The compilers do not yet implement this.

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

13 years agogo: implement build, install, run
Russ Cox [Thu, 15 Dec 2011 03:42:42 +0000 (22:42 -0500)]
go: implement build, install, run

clean is gone; all the intermediate files are created
in a temporary tree that is wiped when the command ends.

Not using go/build's Script because it is not well aligned
with this API.  The various builder methods are copied from
go/build and adapted.  Probably once we delete goinstall
we can delete the Script API too.

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

13 years agofmt: don't recur if String method (etc.) misbehaves
Rob Pike [Thu, 15 Dec 2011 00:37:54 +0000 (16:37 -0800)]
fmt: don't recur if String method (etc.) misbehaves

Fixes #2555.

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

13 years agohtml: don't leave "in column group" mode when ignoring a token
Andrew Balholm [Wed, 14 Dec 2011 23:45:19 +0000 (10:45 +1100)]
html: don't leave "in column group" mode when ignoring a token

Pass tests6.dat, test 26:
foo<col>

| <col>

Also pass tests through test 35:
<table><tr><div><td>

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

13 years agocgo: add basic gccgo support.
Rémy Oudompheng [Wed, 14 Dec 2011 23:40:35 +0000 (15:40 -0800)]
cgo: add basic gccgo support.

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

13 years ago5c, 6c, 8c: support 64-bit switch value
Anthony Martin [Wed, 14 Dec 2011 22:30:40 +0000 (17:30 -0500)]
5c, 6c, 8c: support 64-bit switch value

For real this time. :-)

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

13 years agogzip: Convert between Latin-1 and Unicode
Vadim Vygonets [Wed, 14 Dec 2011 22:17:40 +0000 (17:17 -0500)]
gzip: Convert between Latin-1 and Unicode

I realize I didn't send the tests in last time.  Anyway, I added
a test that knows too much about the package's internal structure,
and I'm not sure whether it's the right thing to do.

Vadik.

R=bradfitz, rsc, go.peter.90
CC=golang-dev
https://golang.org/cl/5450073

13 years agonet/smtp: add CRAM-MD5 authentication
Vadim Vygonets [Wed, 14 Dec 2011 22:17:25 +0000 (17:17 -0500)]
net/smtp: add CRAM-MD5 authentication

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

13 years agoA+C: Vadim Vygonets (individual CLA)
Russ Cox [Wed, 14 Dec 2011 22:17:09 +0000 (17:17 -0500)]
A+C: Vadim Vygonets (individual CLA)

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

13 years agomisc/osx: Rename profile.go to profile_go to avoid confusing scripts
Scott Lawrence [Wed, 14 Dec 2011 21:26:48 +0000 (16:26 -0500)]
misc/osx: Rename profile.go to profile_go to avoid confusing scripts

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

13 years agohtml/template: define the FuncMap type locally
Rob Pike [Wed, 14 Dec 2011 19:22:17 +0000 (11:22 -0800)]
html/template: define the FuncMap type locally
This redefinition means that the public signature of html/template
does not refer to text/template.

Fixes #2546.

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

13 years agogotest: use build.DefaultContext.GOARCH
Robert Hencke [Wed, 14 Dec 2011 19:21:30 +0000 (11:21 -0800)]
gotest: use build.DefaultContext.GOARCH

Fixes https://golang.org/cl/5480060/#msg4

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

13 years agohttp: fix failing Transport HEAD request with gzip-looking response
Brad Fitzpatrick [Wed, 14 Dec 2011 19:20:21 +0000 (11:20 -0800)]
http: fix failing Transport HEAD request with gzip-looking response

We only want to attempt to un-gzip if there's a body (not in
response to a HEAD)

This was accidentally passing before, but revealed to be broken
when c3c6e72d7cc went in.

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

13 years agostrconv: slightly faster int conversion for GOARCH=386
Robert Griesemer [Wed, 14 Dec 2011 19:14:10 +0000 (11:14 -0800)]
strconv: slightly faster int conversion for GOARCH=386

benchmark                           old ns/op    new ns/op    delta
strconv_test.BenchmarkFormatInt         12198        12031   -1.37%
strconv_test.BenchmarkAppendInt          9268         9153   -1.24%
strconv_test.BenchmarkFormatUint         3538         3429   -3.08%
strconv_test.BenchmarkAppendUint         3133         3062   -2.27%

No performance difference for GOARCH=amd64.

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

13 years agojson: treat renamed byte slices the same as []byte
Rob Pike [Wed, 14 Dec 2011 19:03:28 +0000 (11:03 -0800)]
json: treat renamed byte slices the same as []byte
Fixes #2163.

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

13 years agostrconv: even faster int conversion
Robert Griesemer [Wed, 14 Dec 2011 18:45:59 +0000 (10:45 -0800)]
strconv: even faster int conversion

benchmark                           old ns/op    new ns/op    delta
strconv_test.BenchmarkFormatInt         10038         8217  -18.14%
strconv_test.BenchmarkAppendInt          6822         4969  -27.16%
strconv_test.BenchmarkFormatUint         2811         1814  -35.47%
strconv_test.BenchmarkAppendUint         2349         1360  -42.10%

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

13 years agoundo CL 5477092 / c3c6e72d7cc5
Robert Griesemer [Wed, 14 Dec 2011 18:44:34 +0000 (10:44 -0800)]
undo CL 5477092 / c3c6e72d7cc5

The obvious fix is breaking the build in non-obvious ways.
Reverting while waiting for the correct fix, if any is needed.

««« original CL description
net/http: fix bug in error checking

Thanks to josef86@gmail.com for pointing this out.

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

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

13 years agonet/http: fix bug in error checking
Robert Griesemer [Wed, 14 Dec 2011 16:43:42 +0000 (08:43 -0800)]
net/http: fix bug in error checking

Thanks to josef86@gmail.com for pointing this out.

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

13 years agogc: use inferred type rather than original one when reporting non-assignability.
Luuk van Dijk [Wed, 14 Dec 2011 16:34:35 +0000 (17:34 +0100)]
gc: use inferred type rather than original one when reporting non-assignability.

Fixes #2451

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

13 years agocrypto/tls: make compatible with go/build
Russ Cox [Wed, 14 Dec 2011 15:25:48 +0000 (10:25 -0500)]
crypto/tls: make compatible with go/build

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

13 years agohash/crc32: make compatible with go/build
Russ Cox [Wed, 14 Dec 2011 15:25:16 +0000 (10:25 -0500)]
hash/crc32: make compatible with go/build

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

13 years agogo/build: make compatible with go/build
Russ Cox [Wed, 14 Dec 2011 15:24:17 +0000 (10:24 -0500)]
go/build: make compatible with go/build

The irony!

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

13 years agogc: add forgotten typecheck in a lonely corner of sinit
Luuk van Dijk [Wed, 14 Dec 2011 14:54:10 +0000 (15:54 +0100)]
gc: add forgotten typecheck in a lonely corner of sinit

Fixes #2549

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

13 years agogc: inlining (disabled without -l)
Luuk van Dijk [Wed, 14 Dec 2011 14:05:33 +0000 (15:05 +0100)]
gc: inlining (disabled without -l)

Cross- and intra package inlining of single assignments or return <expression>.
Minus some hairy cases, currently including other calls, expressions with closures and ... arguments.

R=rsc, rogpeppe, adg, gri
CC=golang-dev
https://golang.org/cl/5400043

13 years agohtml: close <button> element before opening a new one
Andrew Balholm [Wed, 14 Dec 2011 10:40:31 +0000 (21:40 +1100)]
html: close <button> element before opening a new one

Pass tests6.dat, test 13:
<button><button>

| <html>
|   <head>
|   <body>
|     <button>
|     <button>

Also pass tests through test 25:
<table><colgroup>foo

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

13 years agogc: Use %#F in error messages instead of %F.
Luuk van Dijk [Wed, 14 Dec 2011 07:22:36 +0000 (08:22 +0100)]
gc: Use %#F in error messages instead of %F.

Fixes #2520

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

13 years agogc: suppress non-root cause message for bad receivers.
Luuk van Dijk [Wed, 14 Dec 2011 07:21:37 +0000 (08:21 +0100)]
gc: suppress non-root cause message for bad receivers.

Fixed issue 2500

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

13 years agoundo CL 5485063 / 21595dc0395a
Russ Cox [Wed, 14 Dec 2011 05:46:07 +0000 (00:46 -0500)]
undo CL 5485063 / 21595dc0395a

breaks 64-bit build

««« original CL description
8c: handle 64-bit switch value
Cases must still be 32-bit values, but one thing at a time.

R=ality, ken2, ken
CC=golang-dev
https://golang.org/cl/5485063
»»»

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

13 years agoruntime: bump gc 'extra bytes' check
Christopher Wedgwood [Wed, 14 Dec 2011 05:28:43 +0000 (21:28 -0800)]
runtime: bump gc 'extra bytes' check

(needed for non-zero GOMAXPROCS)

R=iant, rsc
CC=go.peter.90, golang-dev
https://golang.org/cl/5486059

13 years ago8c: handle 64-bit switch value
Russ Cox [Wed, 14 Dec 2011 05:08:38 +0000 (00:08 -0500)]
8c: handle 64-bit switch value
Cases must still be 32-bit values, but one thing at a time.

R=ality, ken2, ken
CC=golang-dev
https://golang.org/cl/5485063

13 years agoencoding/gob: better error messages when types mismatch
Rob Pike [Wed, 14 Dec 2011 04:40:55 +0000 (20:40 -0800)]
encoding/gob: better error messages when types mismatch
The transmitter must encode an interface value if it is to be decoded
into an interface value, but it's a common and confusing error to
encode a concrete value and attempt to decode it into an interface,
particularly *interface{}. This CL attempts to explain things better.

Fixes #2367.

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

13 years agoexp/winfsnotify: fix build.
Yasuhiro Matsumoto [Wed, 14 Dec 2011 02:17:48 +0000 (13:17 +1100)]
exp/winfsnotify: fix build.

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

13 years agospec: values of underlying type uintptr can be converted to unsafe.Pointer
Robert Griesemer [Wed, 14 Dec 2011 01:22:11 +0000 (17:22 -0800)]
spec: values of underlying type uintptr can be converted to unsafe.Pointer

Not a language change, just stating the facts.

Fixes #1793.

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

13 years agosyscall: regenerate z-files for openbsd
Joel Sing [Tue, 13 Dec 2011 23:46:49 +0000 (10:46 +1100)]
syscall: regenerate z-files for openbsd

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

13 years agoruntime: Make gc_test test extra allocated space, not total space.
Ian Lance Taylor [Tue, 13 Dec 2011 23:12:55 +0000 (15:12 -0800)]
runtime: Make gc_test test extra allocated space, not total space.

Testing total space fails for gccgo when not using split
stacks, because then each goroutine has a large stack, and so
the total memory usage is large.

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

13 years agobufio: make the minimum read buffer size 16 bytes.
Rob Pike [Tue, 13 Dec 2011 23:07:17 +0000 (15:07 -0800)]
bufio: make the minimum read buffer size 16 bytes.

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

13 years agotest/garbage: move to test/bench/garbage
Russ Cox [Tue, 13 Dec 2011 23:02:49 +0000 (18:02 -0500)]
test/garbage: move to test/bench/garbage

(These are benchmarks for the garbage collector, not tests.)

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

13 years agofix build, sorry
Russ Cox [Tue, 13 Dec 2011 22:53:00 +0000 (17:53 -0500)]
fix build, sorry

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

13 years agostrconv: some allocation tests
Brad Fitzpatrick [Tue, 13 Dec 2011 22:49:26 +0000 (14:49 -0800)]
strconv: some allocation tests

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

13 years agotest/bench: move to test/bench/shootout
Russ Cox [Tue, 13 Dec 2011 22:46:54 +0000 (17:46 -0500)]
test/bench: move to test/bench/shootout

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

13 years agocontribute.html: do not fill in the reviewer field
Florian Weimer [Tue, 13 Dec 2011 22:45:01 +0000 (17:45 -0500)]
contribute.html: do not fill in the reviewer field

The golang-dev mailing list is added automatically.

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

13 years agoA+C: Florian Weimer (individual CLA)
Russ Cox [Tue, 13 Dec 2011 22:44:44 +0000 (17:44 -0500)]
A+C: Florian Weimer (individual CLA)

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

13 years agomath: delete non-Sqrt-based Hypot
Russ Cox [Tue, 13 Dec 2011 22:08:56 +0000 (17:08 -0500)]
math: delete non-Sqrt-based Hypot

I was confused by the existence of two portable Hypot
routines in the tree when I cleaned things up, and I made
ARM use the wrong (imprecise) one.  Use the right one,
and delete the wrong one.

Fixes arm build.

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

13 years agoundo CL 5414048 / f6b994f33cf4
Russ Cox [Tue, 13 Dec 2011 22:08:18 +0000 (17:08 -0500)]
undo CL 5414048 / f6b994f33cf4

breaks build

««« original CL description
http: close connection after printing panic stack trace
In a testing situation, it's possible for a local http
server to panic and the test exit without the stack trace
ever being printed.
Fixes #2480.

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

»»»

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

13 years agogo/printer, godoc: print comments in example code
Robert Griesemer [Tue, 13 Dec 2011 22:05:05 +0000 (14:05 -0800)]
go/printer, godoc: print comments in example code

- go/printer: support for printing CommentedNodes
- go/doc: collect comments from examples

Fixes #2429.

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

13 years agogofmt: simplify flags
Robert Griesemer [Tue, 13 Dec 2011 22:03:25 +0000 (14:03 -0800)]
gofmt: simplify flags

-tabs replaces -tabindent
-spaces has been removed

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

13 years agogofix: add googlecode module for rewriting Google Code imports
Andrew Gerrand [Tue, 13 Dec 2011 21:46:26 +0000 (08:46 +1100)]
gofix: add googlecode module for rewriting Google Code imports
goinstall: disallow googlecode.com import paths

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

13 years agohttp: close connection after printing panic stack trace
Roger Peppe [Tue, 13 Dec 2011 21:34:22 +0000 (16:34 -0500)]
http: close connection after printing panic stack trace
In a testing situation, it's possible for a local http
server to panic and the test exit without the stack trace
ever being printed.
Fixes #2480.

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

13 years agogofix: add fix httputil
Yasuhiro Matsumoto [Tue, 13 Dec 2011 21:23:06 +0000 (16:23 -0500)]
gofix: add fix httputil

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

13 years agocodereview: fix path slash issue.
Yasuhiro Matsumoto [Tue, 13 Dec 2011 21:18:56 +0000 (16:18 -0500)]
codereview: fix path slash issue.

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

13 years agoarchive/tar: (test) structure comparison not reflect.DeepEqual
Christopher Wedgwood [Tue, 13 Dec 2011 21:08:49 +0000 (08:08 +1100)]
archive/tar: (test) structure comparison not reflect.DeepEqual

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

13 years agomath: regularize build
Russ Cox [Tue, 13 Dec 2011 20:20:12 +0000 (15:20 -0500)]
math: regularize build

This will be nicer to the automatic tools.
It requires a few more assembly stubs
but fewer Go files.

There are a few instances where it looks like
there are new blobs of code, but they are just
being copied out of deleted files.

There is no new code here.

Suppose you have a portable implementation for Sin
and a 386-specific assembly one.  The old way to
do this was to write three files

sin_decl.go
   func Sin(x float64) float64  // declaration only
sin_386.s
   assembly implementation

sin_port.go
   func Sin(x float64) float64 { ... }  // pure-Go impl

and then link in either sin_decl.go+sin_386.s or
just sin_port.go.  The Makefile actually did the magic
of linking in only the _port.go files for those without
assembly and only the _decl.go files for those with
assembly, or at least some of that magic.

The biggest problem with this, beyond being hard
to explain to the build system, is that once you do
explain it to the build system, godoc knows which
of sin_port.go or sin_decl.go are involved on a given
architecture, and it (correctly) ignores the other.
That means you have to put identical doc comments
in both files.

The new approach, which is more like what we did
in the later packages math/big and sync/atomic,
is to have

sin.go
   func Sin(x float64) float64  // decl only
   func sin(x float64) float64 {...}  // pure-Go impl

sin_386.s
   // assembly for Sin (ignores sin)
sin_amd64.s
   // assembly for Sin: jmp sin
sin_arm.s
   // assembly for Sin: jmp sin

Once we abandon Makefiles we can put all the assembly
stubs in one source file, so the number of files will
actually go down.

Chris asked whether the branches cost anything.
Given that they are branching to pure-Go implementations
that are not typically known for their speed, the single
direct branch is not going to be noticeable.  That is,
it's on the slow path.

An alternative would have been to preserve the old
"only write assembly files when there's an implementation"
and still have just one copy of the declaration of Sin
(and thus one doc comment) by doing:

sin.go
   func Sin(x float64) float64 { return sin(x) }

sin_decl.go
   func sin(x float64) float64 // declaration only
sin_386.s
   // assembly for sin

sin_port.go
   func sin(x float64) float64 { portable code }

In this version everyone would link in sin.go and
then either sin_decl.go+sin_386.s or sin_port.go.

This has an extra function call on all paths, including
the "fast path" to get to assembly, and it triples the
number of Go files involved compared to what I did
in this CL.  On the other hand you don't have to
write assembly stubs.  After starting down this path
I decided that the assembly stubs were the easier
approach.

As for generating the assembly stubs on the fly, much
of the goal here is to eliminate magic from the build
process, so that zero-configuration tools like goinstall
or the new go tool can handle this package.

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