]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agoallow direct conversion between string and named []byte, []rune
Russ Cox [Tue, 22 Nov 2011 17:30:02 +0000 (12:30 -0500)]
allow direct conversion between string and named []byte, []rune

The allowed conversions before and after are:
        type Tstring string
        type Tbyte []byte
        type Trune []rune

        string <-> string  // ok
        string <-> []byte  // ok
        string <-> []rune // ok
        string <-> Tstring // ok
        string <-> Tbyte // was illegal, now ok
        string <-> Trune // was illegal, now ok

        Tstring <-> string  // ok
        Tstring <-> []byte  // ok
        Tstring <-> []rune // ok
        Tstring <-> Tstring // ok
        Tstring <-> Tbyte // was illegal, now ok
        Tstring <-> Trune // was illegal, now ok

Update spec, compiler, tests.  Use in a few packages.

We agreed on this a few months ago but never implemented it.

Fixes #1707.

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

13 years agoos: make ReadAt comment clearer
Russ Cox [Tue, 22 Nov 2011 17:22:28 +0000 (12:22 -0500)]
os: make ReadAt comment clearer

Fixes #2486.

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

13 years agocgo: add support for callbacks from dynamic libraries
Dmitriy Vyukov [Tue, 22 Nov 2011 14:57:49 +0000 (17:57 +0300)]
cgo: add support for callbacks from dynamic libraries

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

13 years agohtml: copy attributes from extra <html> tags to root element
Andrew Balholm [Tue, 22 Nov 2011 01:08:22 +0000 (12:08 +1100)]
html: copy attributes from extra <html> tags to root element

Pass tests2.dat, test 50:
<!DOCTYPE html><html><body><html id=x>

| <!DOCTYPE html>
| <html>
|   id="x"
|   <head>
|   <body>

Also pass tests through test 56:
<!DOCTYPE html>X<p/x/y/z>

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

13 years agohtml: ignore whitespace before <head> element
Andrew Balholm [Mon, 21 Nov 2011 22:27:27 +0000 (09:27 +1100)]
html: ignore whitespace before <head> element

Pass tests2.dat, test 47:
" \n "
(That is, two spaces separated by a newline)

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

Also pass tests through test 49:
<!DOCTYPE html><script>
</script>  <title>x</title>  </head>

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

13 years agogoinstall: support googlecode subrepos and add repo match tests
Andrew Gerrand [Mon, 21 Nov 2011 20:10:25 +0000 (07:10 +1100)]
goinstall: support googlecode subrepos and add repo match tests
goinstall: don't hit network unless a checkout or update is required

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

13 years agocrypto/x509, crypto/tls: support PKCS#8 private keys.
Adam Langley [Mon, 21 Nov 2011 19:18:42 +0000 (14:18 -0500)]
crypto/x509, crypto/tls: support PKCS#8 private keys.

OpenSSL 1.0.0 has switched to generating PKCS#8 format private keys by
default. This change allows http.ListenAndServeTLS to work with either
types of keys.

See http://groups.google.com/group/golang-nuts/browse_thread/thread/84715b5f0c9e3c30/63a8a27b53e102a6

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

13 years agobcrypt: Correct typo in package comment.
Benny Siegert [Mon, 21 Nov 2011 17:11:34 +0000 (09:11 -0800)]
bcrypt: Correct typo in package comment.

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

13 years agojson: speed up encoding, caching reflect calls
Brad Fitzpatrick [Mon, 21 Nov 2011 15:49:14 +0000 (07:49 -0800)]
json: speed up encoding, caching reflect calls

Before
json.BenchmarkCodeEncoder  10  181232100 ns/op  10.71 MB/s
json.BenchmarkCodeMarshal  10  184578000 ns/op  10.51 MB/s

After:
json.BenchmarkCodeEncoder  10  146444000 ns/op  13.25 MB/s
json.BenchmarkCodeMarshal  10  151428500 ns/op  12.81 MB/s

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

13 years agomath: faster Cbrt
Charles L. Dorian [Mon, 21 Nov 2011 14:56:07 +0000 (09:56 -0500)]
math: faster Cbrt

For amd64, from 127 to 105 ns/op; for 386, from 208 to 169 ns/op.

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

13 years agosyscall: fix for Plan 9 build
Lucio De Re [Mon, 21 Nov 2011 14:55:15 +0000 (09:55 -0500)]
syscall: fix for Plan 9 build

exec_plan9.go:
. Adjusted return argument to match other changes.
#mksyscall.pl:
. Replaced "err = e1" with "err = NewError(e1)".
* Change abandoned, Russ made a better suggestion involving
  syscall_plan9.go.
syscall_plan9.go:
. Removed redundant "err = nil" lines.
. Adjusted //sys lines for mksyscall.pl.
* Replaced "err string" with "err ErrorString" in return arguments.
zsyscall_plan9_386.go:
. This module ought to be generated, but as it exists in the
  repository, I rebuilt it and checked that it matched expectations.
  Anybody is welcome to remove this from the repository if
  they feel it should go, but remember that not all Plan 9
  installations have a working Perl.

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

13 years agogofix: test and fix missorted renames
Russ Cox [Mon, 21 Nov 2011 14:41:25 +0000 (09:41 -0500)]
gofix: test and fix missorted renames

Also introduce a new insertion heuristic:
insert new import next to existing import
with the longest matching prefix.

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

13 years agosql: more driver docs & tests; no functional changes
Brad Fitzpatrick [Sun, 20 Nov 2011 19:56:49 +0000 (14:56 -0500)]
sql: more driver docs & tests; no functional changes

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

13 years agoexp/ssh: alter Session to match the exec.Cmd API
Dave Cheney [Sun, 20 Nov 2011 16:46:35 +0000 (11:46 -0500)]
exp/ssh: alter Session to match the exec.Cmd API

This CL inverts the direction of the Stdin/out/err members of the
Session struct so they reflect the API of the exec.Cmd. In doing so
it borrows heavily from the exec package.

Additionally Shell now returns immediately, wait for completion using
Wait. Exec calls Wait internally and so blocks until the remote
command is complete.

Credit to Gustavo Niemeyer for the impetus for this CL.

R=rsc, agl, n13m3y3r, huin, bradfitz
CC=cw, golang-dev
https://golang.org/cl/5322055

13 years agohtml: refactor parse test infrastructure
Andrew Balholm [Sun, 20 Nov 2011 11:42:28 +0000 (22:42 +1100)]
html: refactor parse test infrastructure

My excuse for doing this is that test cases with newlines in them didn't
work. But instead of just fixing that, I rearranged everything in
parse_test.go to use fewer channels and pipes, and just call a
straightforward function to read test cases from a file.

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

13 years agoexp/gui: delete exp/gui and exp/gui/x11. They are moving to
Nigel Tao [Sun, 20 Nov 2011 10:56:17 +0000 (21:56 +1100)]
exp/gui: delete exp/gui and exp/gui/x11. They are moving to
x-go-binding.googlecode.com.

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

13 years agosyscall: add SUSv3 RLIMIT/RUSAGE constants
Sébastien Paolacci [Sat, 19 Nov 2011 06:17:40 +0000 (15:17 +0900)]
syscall: add SUSv3 RLIMIT/RUSAGE constants

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

13 years agogo/printer: cleanup more string/byte conversions
Robert Griesemer [Sat, 19 Nov 2011 04:55:35 +0000 (20:55 -0800)]
go/printer: cleanup more string/byte conversions

Slight slow-down for printer benchmark (-0.7%) before
applying CL 5416049 (which will wash it out). Code is
cleaner and simpler.

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

13 years agoA+C: Sébastien Paolacci (individual CLA)
Mikio Hara [Sat, 19 Nov 2011 04:47:15 +0000 (13:47 +0900)]
A+C: Sébastien Paolacci (individual CLA)

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

13 years agolibmach: fix for Plan 9 build
Lucio De Re [Sat, 19 Nov 2011 04:11:50 +0000 (23:11 -0500)]
libmach: fix for Plan 9 build

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

13 years agogo/printer: remove gratuitous string/[]byte conversions
Robert Griesemer [Sat, 19 Nov 2011 03:10:45 +0000 (19:10 -0800)]
go/printer: remove gratuitous string/[]byte conversions

Cleanup and slight performance improvement (1.5%).

Before (best of 3 runs):
printer.BenchmarkPrint       50   47377420 ns/op

After (best of 3 runs):
printer.BenchmarkPrint       50   46707180 ns/op

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

13 years agomisc/osx: Add scripts to create OS X package and disk image
Scott Lawrence [Sat, 19 Nov 2011 01:05:53 +0000 (19:05 -0600)]
misc/osx: Add scripts to create OS X package and disk image

Fixes #2327.

R=golang-dev, rsc, roberto, jdpoirier
CC=golang-dev
https://golang.org/cl/5375049

13 years agohtml/template: fix documentation formatting
Andrew Gerrand [Fri, 18 Nov 2011 23:54:44 +0000 (10:54 +1100)]
html/template: fix documentation formatting

See http://weekly.golang.org/pkg/html/template/

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

13 years agohtml/template, net/http, websocket: fix import paths in comments
Lucio De Re [Fri, 18 Nov 2011 23:33:44 +0000 (18:33 -0500)]
html/template, net/http, websocket: fix import paths in comments

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

13 years agocgo: document export of Go functions to C.
Rémy Oudompheng [Fri, 18 Nov 2011 23:24:59 +0000 (18:24 -0500)]
cgo: document export of Go functions to C.

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

13 years agotemplate/parse: rename Set to Parse
Rob Pike [Fri, 18 Nov 2011 21:10:15 +0000 (13:10 -0800)]
template/parse: rename Set to Parse
Preamble to the simplification of the template API.
Although the signature of Parse (nee Set) changes,
it's really an internal function, used only by
text/template.

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

13 years agocrypto/x509: fix documentation typos
Adam Langley [Fri, 18 Nov 2011 20:48:34 +0000 (15:48 -0500)]
crypto/x509: fix documentation typos

Thanks to Jeff R. Allen for pointing them out.

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

13 years agocodereview: gofmt check for non-src/ files
David Crawshaw [Fri, 18 Nov 2011 20:42:30 +0000 (12:42 -0800)]
codereview: gofmt check for non-src/ files

Gives other projects the benefit of the gofmt presubmit.
Results in minor changes in the doc/ directory:
        find doc -name \*.go -exec gofmt -d {} \;

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

13 years agotag weekly.2011-11-18
Andrew Gerrand [Fri, 18 Nov 2011 20:21:05 +0000 (07:21 +1100)]
tag weekly.2011-11-18

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

13 years agoweekly.2011-11-18 weekly.2011-11-18
Andrew Gerrand [Fri, 18 Nov 2011 20:20:02 +0000 (07:20 +1100)]
weekly.2011-11-18

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

13 years agocodereview: put message back in post-commit mails
Russ Cox [Fri, 18 Nov 2011 19:30:06 +0000 (14:30 -0500)]
codereview: put message back in post-commit mails

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

13 years agosyscall: fix env routines for Plan 9
Lucio De Re [Fri, 18 Nov 2011 18:36:06 +0000 (13:36 -0500)]
syscall: fix env routines for Plan 9

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

13 years agocodereview: undo last night's rollback
Russ Cox [Fri, 18 Nov 2011 17:58:44 +0000 (12:58 -0500)]
codereview: undo last night's rollback

Update version check from 1.4 to 1.9.  Suggest 2.0.

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

13 years agoexp/ssh: Add support for (most) of the ciphers from RFC4253, RFC4344 and RFC4345.
John Beisley [Fri, 18 Nov 2011 17:56:57 +0000 (12:56 -0500)]
exp/ssh: Add support for (most) of the ciphers from RFC4253, RFC4344 and RFC4345.

R=dave, agl, taruti, rsc, r
CC=golang-dev
https://golang.org/cl/5342057

13 years agoAdd huin@google.com to the CONTRIBUTORS
Adam Langley [Fri, 18 Nov 2011 17:41:25 +0000 (12:41 -0500)]
Add huin@google.com to the CONTRIBUTORS

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

13 years agoexp/terminal: fix Makefile formatting for deps.bash
Dmitriy Vyukov [Fri, 18 Nov 2011 12:30:36 +0000 (15:30 +0300)]
exp/terminal: fix Makefile formatting for deps.bash
deps.bash does not understand current format,
so make.bash fails (with MAKEFLAGS=-j20).

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

13 years agoundo CL 5395044 / d88e746d3785
Andrew Gerrand [Fri, 18 Nov 2011 10:33:04 +0000 (21:33 +1100)]
undo CL 5395044 / d88e746d3785

Breaks with hg 1.6.4. Roll back until it's fixed.

««« original CL description
codereview: cleanup + basic tests

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

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

13 years agotext/template: refactor set parsing
Rob Pike [Fri, 18 Nov 2011 06:53:23 +0000 (22:53 -0800)]
text/template: refactor set parsing
Parse {{define}} blocks during template parsing rather than separately as a set-specific thing.
This cleans up set parse significantly, and enables the next step, if we want, to unify the
API for templates and sets.
Other than an argument change to parse.Parse, which is in effect an internal function and
unused by client code, there is no API change and no spec change yet.

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

13 years agocodereview: cleanup + basic tests
Russ Cox [Fri, 18 Nov 2011 05:16:15 +0000 (00:16 -0500)]
codereview: cleanup + basic tests

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

13 years agodoc: link to Chinese translation of A Tour of Go
Andrew Gerrand [Fri, 18 Nov 2011 04:22:48 +0000 (15:22 +1100)]
doc: link to Chinese translation of A Tour of Go

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

13 years agoexp/terminal: fix build after os.Errno changes
Gustavo Niemeyer [Fri, 18 Nov 2011 03:12:57 +0000 (01:12 -0200)]
exp/terminal: fix build after os.Errno changes

Also include exp/terminal in linux build so such failures
are noticed.

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

13 years agoruntime: add nanotime for Plan 9
Anthony Martin [Fri, 18 Nov 2011 03:09:28 +0000 (22:09 -0500)]
runtime: add nanotime for Plan 9

R=paulzhol, rsc, dave, rminnich
CC=golang-dev
https://golang.org/cl/5327063

13 years agohtml: fix doc after Err method name change
Gustavo Niemeyer [Fri, 18 Nov 2011 03:06:59 +0000 (01:06 -0200)]
html: fix doc after Err method name change

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

13 years agomime: remove ".wav" from tests (to fix build)
Alex Brainman [Fri, 18 Nov 2011 02:24:17 +0000 (13:24 +1100)]
mime: remove ".wav" from tests (to fix build)

It looks like not all computers have
mime type for .wav extension.

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

13 years agomisc/windows packager development intermediate check-in
Joe Poirier [Thu, 17 Nov 2011 23:54:06 +0000 (17:54 -0600)]
misc/windows packager development intermediate check-in

The installer now: allows a user to select an alternative
install directory, it now adds a Go folder to the Programs
Menu, and it places two shortcuts on the user's desktop.
The Program Menu folder contains shortcuts to the uninstaller
and two batch files, go.bat and godoc.bat. The desktop
shortcuts also point to go.bat and godoc.bat.

go.bat sets the Go environment, including Path, and spawns a
Window's shell. godoc.bat starts the godoc server at
localhost:6060 then spawns a browser window pointing to the
document server.

Setting the environment temporarily and spawning a shell, via
go.bat, should be safer than messing with the system's environment
and it makes the user experience a bit more streamlined.

The packager does work in its current state but it still needs
some polishing. And yes, the plan is to add a dialogue to allow
the user to decline the desktop shortcuts.

R=rsc, alex.brainman, tjyang2001
CC=golang-dev
https://golang.org/cl/5399042

13 years agomime: implement TypeByExtension for windows
Alex Brainman [Thu, 17 Nov 2011 23:07:36 +0000 (10:07 +1100)]
mime: implement TypeByExtension for windows

Fixes #2071.

R=golang-dev, hcwfrichter, pascal, rsc
CC=golang-dev
https://golang.org/cl/5369056

13 years agogodoc: provide mode for flat (non-indented) directory listings
Robert Griesemer [Thu, 17 Nov 2011 22:47:49 +0000 (14:47 -0800)]
godoc: provide mode for flat (non-indented) directory listings

This feature should make it easier to look at very large
directory trees.

- a new mode (URL: /pkg/?m=flat) shows directory listings w/o
  indentation and entries with full path (html and text mode)
- in text mode, hierarchical (non-flat) directory listings are
  now presented with indentation (/pkg/?m=text)
- in html mode, hierarchical (non-flat) directory listings are
  presented with slightly less indentation
- there is an internal hook for programmatic control of the
  display mode (for specialized versions of godoc).

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

13 years agoos: re-enable hostname test on openbsd
Joel Sing [Thu, 17 Nov 2011 14:53:07 +0000 (01:53 +1100)]
os: re-enable hostname test on openbsd

Now that Sysctl() works, re-enable the hostname test.

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

13 years agosyscall: hostname/domainname fix for openbsd
Joel Sing [Thu, 17 Nov 2011 14:52:39 +0000 (01:52 +1100)]
syscall: hostname/domainname fix for openbsd

Work around a bug that was fixed after OpenBSD 5.0 - a request for
kern.hostname or kern.domainname with a nil value for oldp will result
in a length of zero being returned. If we hit this case use a length
of MAXHOSTNAMELEN (256).

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

13 years agosyscall: implement nametomib for openbsd.
Joel Sing [Thu, 17 Nov 2011 12:13:49 +0000 (23:13 +1100)]
syscall: implement nametomib for openbsd.

Move the existing darwin/freebsd specific nametomib implementation
into the respective operating system dependent files.

Provide a nametomib implementation for openbsd, which operates on a
sysctl MIB that has been pre-generated from the various system headers
by mksysctl_openbsd.pl.

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

13 years agohtml: parse <isindex>
Andrew Balholm [Thu, 17 Nov 2011 02:12:13 +0000 (13:12 +1100)]
html: parse <isindex>

Pass tests2.dat, test 42:
<isindex test=x name=x>

| <html>
|   <head>
|   <body>
|     <form>
|       <hr>
|       <label>
|         "This is a searchable index. Enter search keywords: "
|         <input>
|           name="isindex"
|           test="x"
|       <hr>

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

13 years agohttp: fix serving from CWD with http.ServeFile
Andrew Gerrand [Thu, 17 Nov 2011 00:42:25 +0000 (11:42 +1100)]
http: fix serving from CWD with http.ServeFile
http: make Dir("") equivalent to Dir(".")

Fixes #2471.

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

13 years agoexp/ssh: change test listen address, also exit test if fails
Alex Brainman [Thu, 17 Nov 2011 00:20:42 +0000 (11:20 +1100)]
exp/ssh: change test listen address, also exit test if fails

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

13 years agoreflect: make Value an opaque struct
Russ Cox [Thu, 17 Nov 2011 00:18:25 +0000 (19:18 -0500)]
reflect: make Value an opaque struct

Making Value opaque means we can drop the interface kludges
in favor of a significantly simpler and faster representation.
v.Kind() will be a prime candidate for inlining too.

On a Thinkpad X201s using -benchtime 10:

benchmark                           old ns/op    new ns/op    delta
json.BenchmarkCodeEncoder           284391780    157415960  -44.65%
json.BenchmarkCodeMarshal           286979140    158992020  -44.60%
json.BenchmarkCodeDecoder           717175800    388288220  -45.86%
json.BenchmarkCodeUnmarshal         734470500    404548520  -44.92%
json.BenchmarkCodeUnmarshalReuse    707172280    385258720  -45.52%
json.BenchmarkSkipValue              24630036     18557062  -24.66%

benchmark                            old MB/s     new MB/s  speedup
json.BenchmarkCodeEncoder                6.82        12.33    1.81x
json.BenchmarkCodeMarshal                6.76        12.20    1.80x
json.BenchmarkCodeDecoder                2.71         5.00    1.85x
json.BenchmarkCodeUnmarshal              2.64         4.80    1.82x
json.BenchmarkCodeUnmarshalReuse         2.74         5.04    1.84x
json.BenchmarkSkipValue                 77.92       103.42    1.33x

I cannot explain why BenchmarkSkipValue gets faster.
Maybe it is one of those code alignment things.

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

13 years agogofmt: do not stop test.sh after 1 error
Russ Cox [Wed, 16 Nov 2011 23:44:21 +0000 (18:44 -0500)]
gofmt: do not stop test.sh after 1 error

Fix bug377.go to be gofmt-compliant.

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

13 years agohtml: parse </optgroup> and </option>
Andrew Balholm [Wed, 16 Nov 2011 23:25:33 +0000 (10:25 +1100)]
html: parse </optgroup> and </option>

Pass tests2.dat, test 35:
<!DOCTYPE html><select><optgroup><option></optgroup><option><select><option>

| <!DOCTYPE html>
| <html>
|   <head>
|   <body>
|     <select>
|       <optgroup>
|         <option>
|       <option>
|     <option>

Also pass tests through test 41:
<!DOCTYPE html><!-- XXX - XXX - XXX -->

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

13 years agoexp/ssh: fix test?
Russ Cox [Wed, 16 Nov 2011 23:13:50 +0000 (18:13 -0500)]
exp/ssh: fix test?

Fixes use of c after Dial failure (causes crash).
May fix Dial failure by listening to 127.0.0.1:0
instead of 0.0.0.0:0 (tests should only listen on
localhost).

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

13 years agogo/printer: make //line formatting idempotent
Russ Cox [Wed, 16 Nov 2011 22:55:35 +0000 (17:55 -0500)]
go/printer: make //line formatting idempotent

Fixes "test.sh" (long test) in src/cmd/gofmt.

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

13 years agosyscall, os, time: fix Plan 9 build
Lucio De Re [Wed, 16 Nov 2011 22:37:54 +0000 (17:37 -0500)]
syscall, os, time: fix Plan 9 build

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

13 years agoexp/ssh: add to pkg Makefile
Christopher Wedgwood [Wed, 16 Nov 2011 22:34:18 +0000 (17:34 -0500)]
exp/ssh: add to pkg Makefile

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

13 years agogc: support for building with Plan 9 yacc
Anthony Martin [Wed, 16 Nov 2011 21:58:02 +0000 (16:58 -0500)]
gc: support for building with Plan 9 yacc

I've modified Plan 9's yacc to work with
the grammar in go.y.  These are the only
changes necessary on the Go side.

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

13 years agogo/ast: remove unused receiver names (cleanup)
Robert Griesemer [Wed, 16 Nov 2011 21:41:26 +0000 (13:41 -0800)]
go/ast: remove unused receiver names (cleanup)

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

13 years agocov: fix for Plan 9 build
Lucio De Re [Wed, 16 Nov 2011 21:23:50 +0000 (16:23 -0500)]
cov: fix for Plan 9 build

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

13 years agonet/http: fix EOF handling on response body
Gustavo Niemeyer [Wed, 16 Nov 2011 19:35:47 +0000 (17:35 -0200)]
net/http: fix EOF handling on response body

http.Response is currently returning 0, nil on EOF.

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

13 years agofcgi: fix server capability discovery
Brad Fitzpatrick [Wed, 16 Nov 2011 18:11:39 +0000 (10:11 -0800)]
fcgi: fix server capability discovery

The wrong length was being sent, and two parameters
were also transposed. Made the record type be a type
and made the constants typed, to prevent that sort
of bug in the future.

Fixes #2469

R=golang-dev, edsrzf
CC=golang-dev
https://golang.org/cl/5394046

13 years agohtml/template: indirect top-level values before printing
Rob Pike [Wed, 16 Nov 2011 17:32:52 +0000 (09:32 -0800)]
html/template: indirect top-level values before printing
text/template does this (in an entirely different way), so
make html/template do the same. Before this fix, the template
{{.}} given a pointer to a string prints its address instead of its
value.

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

13 years agoexp/ssh: fix unmarshal test
Dave Cheney [Wed, 16 Nov 2011 15:19:56 +0000 (10:19 -0500)]
exp/ssh: fix unmarshal test

Ensure that empty NameLists always return
a zero length []string, not nil.

In practice NameLists are only used in a few
message types and always consumed by a for
range function so the difference between nil
and []string{} is not significant.

Also, add exp/ssh to pkg/Makefile as suggested
by rsc.

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

13 years agohtml: parse <optgroup> tags
Andrew Balholm [Wed, 16 Nov 2011 08:25:55 +0000 (19:25 +1100)]
html: parse <optgroup> tags

Pass tests2.dat, test 34:
<!DOCTYPE html><select><option><optgroup>

| <!DOCTYPE html>
| <html>
|   <head>
|   <body>
|     <select>
|       <option>
|       <optgroup>

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

13 years agohtml: parse <caption> elements
Andrew Balholm [Wed, 16 Nov 2011 01:18:11 +0000 (12:18 +1100)]
html: parse <caption> elements

Pass tests2.dat, test 33:
<!DOCTYPE html><table><caption>test TEST</caption><td>test

| <!DOCTYPE html>
| <html>
|   <head>
|   <body>
|     <table>
|       <caption>
|         "test TEST"
|       <tbody>
|         <tr>
|           <td>
|             "test"

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

13 years agoexp/sql: NumInput() allow -1 to ignore checking.
Yasuhiro Matsumoto [Wed, 16 Nov 2011 00:29:43 +0000 (16:29 -0800)]
exp/sql: NumInput() allow -1 to ignore checking.
Some database driver can't get number of parameters.
For example:
        http://support.microsoft.com/kb/240205/en-us
So, added way to ignore checking number of parameters with return -1.

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

13 years agosql: document that for drivers, io.EOF means no more rows
Brad Fitzpatrick [Tue, 15 Nov 2011 22:29:45 +0000 (14:29 -0800)]
sql: document that for drivers, io.EOF means no more rows

This was used in the sql package + tests, but never
documented.

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

13 years agonet, syscall: add missing copyright notices
Mikio Hara [Tue, 15 Nov 2011 21:59:08 +0000 (06:59 +0900)]
net, syscall: add missing copyright notices

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

13 years agoos: fix comment per CL 5370091
Russ Cox [Tue, 15 Nov 2011 19:54:00 +0000 (14:54 -0500)]
os: fix comment per CL 5370091

Made the edit in the wrong client before submitting.

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

13 years agoos: fix windows build
Russ Cox [Tue, 15 Nov 2011 19:05:18 +0000 (14:05 -0500)]
os: fix windows build

TBR=brainman
CC=golang-dev
https://golang.org/cl/5373105

13 years agoencoding/json: make BenchmarkSkipValue more consistent
Russ Cox [Tue, 15 Nov 2011 18:59:59 +0000 (13:59 -0500)]
encoding/json: make BenchmarkSkipValue more consistent

Move scanner allocation out of loop.
It's the only allocation in the test so it dominates
when it triggers a garbage collection.

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

13 years agomisc/emacs: add delete builtin
Bobby Powers [Tue, 15 Nov 2011 18:22:34 +0000 (10:22 -0800)]
misc/emacs: add delete builtin

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

13 years agotesting: print test results to standard output
Russ Cox [Tue, 15 Nov 2011 18:09:19 +0000 (13:09 -0500)]
testing: print test results to standard output

Errors in the code under test go to standard output.
Errors in testing or its usage go to standard error.

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

13 years agomisc/benchcmp: benchmark comparison script
Russ Cox [Tue, 15 Nov 2011 17:49:22 +0000 (12:49 -0500)]
misc/benchcmp: benchmark comparison script

I've been using this since April and posted it on the
mailing list, but it seems worth having in the repository.
Not sure about the location.

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

13 years agosyscall: make windows build again after d3963c0fca78 change
Alex Brainman [Tue, 15 Nov 2011 17:48:22 +0000 (12:48 -0500)]
syscall: make windows build again after d3963c0fca78 change

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

13 years agoallow copy of struct containing unexported fields
Russ Cox [Tue, 15 Nov 2011 17:20:59 +0000 (12:20 -0500)]
allow copy of struct containing unexported fields

An experiment: allow structs to be copied even if they
contain unexported fields.  This gives packages the
ability to return opaque values in their APIs, like reflect
does for reflect.Value but without the kludgy hacks reflect
resorts to.

In general, we trust programmers not to do silly things
like *x = *y on a package's struct pointers, just as we trust
programmers not to do unicode.Letter = unicode.Digit,
but packages that want a harder guarantee can introduce
an extra level of indirection, like in the changes to os.File
in this CL or by using an interface type.

All in one CL so that it can be rolled back more easily if
we decide this is a bad idea.

Originally discussed in March 2011.
https://groups.google.com/group/golang-dev/t/3f5d30938c7c45ef

R=golang-dev, adg, dvyukov, r, bradfitz, jan.mercl, gri
CC=golang-dev
https://golang.org/cl/5372095

13 years agostrconv: make Ftoa faster
Russ Cox [Tue, 15 Nov 2011 17:17:25 +0000 (12:17 -0500)]
strconv: make Ftoa faster

Make code amenable to escape analysis
so that the decimal values do not escape.

benchmark                               old ns/op    new ns/op    delta
strconv_test.BenchmarkAtof64Decimal           229          233   +1.75%
strconv_test.BenchmarkAtof64Float             261          263   +0.77%
strconv_test.BenchmarkAtof64FloatExp         7760         7757   -0.04%
strconv_test.BenchmarkAtof64Big              3086         3053   -1.07%
strconv_test.BenchmarkFtoa64Decimal          6866         2629  -61.71%
strconv_test.BenchmarkFtoa64Float            7211         3064  -57.51%
strconv_test.BenchmarkFtoa64FloatExp        12587         8263  -34.35%
strconv_test.BenchmarkFtoa64Big              7058         2825  -59.97%
json.BenchmarkCodeEncoder               357355200    276528200  -22.62%
json.BenchmarkCodeMarshal               360735200    279646400  -22.48%
json.BenchmarkCodeDecoder               731528600    709460600   -3.02%
json.BenchmarkCodeUnmarshal             754774400    731051200   -3.14%
json.BenchmarkCodeUnmarshalReuse        713379000    704218000   -1.28%
json.BenchmarkSkipValue                  51594300     51682600   +0.17%

benchmark                                old MB/s     new MB/s  speedup
json.BenchmarkCodeEncoder                    5.43         7.02    1.29x
json.BenchmarkCodeMarshal                    5.38         6.94    1.29x
json.BenchmarkCodeDecoder                    2.65         2.74    1.03x
json.BenchmarkCodeUnmarshal                  2.57         2.65    1.03x
json.BenchmarkCodeUnmarshalReuse             2.72         2.76    1.01x
json.BenchmarkSkipValue                     38.61        38.55    1.00x

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

13 years agoruntime: avoid allocation for make([]T, 0)
Russ Cox [Tue, 15 Nov 2011 17:05:25 +0000 (12:05 -0500)]
runtime: avoid allocation for make([]T, 0)

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

13 years agostrconv: add Ftoa benchmarks
Russ Cox [Tue, 15 Nov 2011 16:02:04 +0000 (11:02 -0500)]
strconv: add Ftoa benchmarks

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

13 years agoencoding/json: add marshal/unmarshal benchmark
Russ Cox [Tue, 15 Nov 2011 15:58:19 +0000 (10:58 -0500)]
encoding/json: add marshal/unmarshal benchmark

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

13 years agonet/http: fix build
Mikio Hara [Tue, 15 Nov 2011 05:04:58 +0000 (14:04 +0900)]
net/http: fix build

empty is already not a nil.

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

13 years agohtml: auto-close <p> elements when starting <form> element.
Andrew Balholm [Tue, 15 Nov 2011 04:31:22 +0000 (15:31 +1100)]
html: auto-close <p> elements when starting <form> element.

Pass tests2.dat, test 26:
<!doctypehtml><p><form>

| <!DOCTYPE html>
| <html>
|   <head>
|   <body>
|     <p>
|     <form>

Also pass tests through test 32:
<!DOCTYPE html><!-- X

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

13 years agoxml: fix build
Mikio Hara [Tue, 15 Nov 2011 01:28:01 +0000 (10:28 +0900)]
xml: fix build

empty is already not a nil.

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

13 years agogo/build: fix build
Mikio Hara [Tue, 15 Nov 2011 01:27:43 +0000 (10:27 +0900)]
go/build: fix build

empty is already not a nil.

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

13 years agohtml: parse and render <plaintext> elements
Andrew Balholm [Tue, 15 Nov 2011 00:39:18 +0000 (11:39 +1100)]
html: parse and render <plaintext> elements

Pass tests2.dat, test 10:
<table><plaintext><td>

| <html>
|   <head>
|   <body>
|     <plaintext>
|       "<td>"
|     <table>

Also pass tests through test 25:
<!doctypehtml><p><dd>

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

13 years agomath/big: replace nat{} -> nat(nil)
Robert Griesemer [Mon, 14 Nov 2011 21:35:22 +0000 (13:35 -0800)]
math/big: replace nat{} -> nat(nil)

No need for creating a new nat each time.
Per Roger Peppe's suggestion; assuming
nat(nil) produces better code than nat{}.

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

13 years agocgi: make test code more readable
Brad Fitzpatrick [Mon, 14 Nov 2011 21:12:08 +0000 (13:12 -0800)]
cgi: make test code more readable

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

13 years agoreflect: empty slice/map is not DeepEqual to nil
Russ Cox [Mon, 14 Nov 2011 21:11:15 +0000 (16:11 -0500)]
reflect: empty slice/map is not DeepEqual to nil

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

13 years agofmt: distinguish empty vs nil slice/map in %#v
Russ Cox [Mon, 14 Nov 2011 21:10:58 +0000 (16:10 -0500)]
fmt: distinguish empty vs nil slice/map in %#v

Also update Scanf tests to cope with DeepEqual
distinguishing empty vs nil slice.

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

13 years agoencoding/json: decode [] as empty slice, not nil slice
Russ Cox [Mon, 14 Nov 2011 21:03:23 +0000 (16:03 -0500)]
encoding/json: decode [] as empty slice, not nil slice

Test was already present, but bug in reflect.DeepEqual hid this bug.

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

13 years ago6l, 8l: add missing space in error message
Lucio De Re [Mon, 14 Nov 2011 20:59:27 +0000 (15:59 -0500)]
6l, 8l: add missing space in error message

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

13 years agocrypto/tls: fix handshake message test
Russ Cox [Mon, 14 Nov 2011 20:21:08 +0000 (15:21 -0500)]
crypto/tls: fix handshake message test

This test breaks when I make reflect.DeepEqual
distinguish empty slices from nil slices.

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

13 years agotime: fix test hang
Dmitriy Vyukov [Mon, 14 Nov 2011 19:31:39 +0000 (22:31 +0300)]
time: fix test hang

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

13 years agomisc/notepadplus: error and rune support
Anthony Starks [Mon, 14 Nov 2011 19:19:08 +0000 (11:19 -0800)]
misc/notepadplus: error and rune support

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

13 years agomisc/bbedit: error and rune support
Anthony Starks [Mon, 14 Nov 2011 19:18:00 +0000 (11:18 -0800)]
misc/bbedit: error and rune support

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

13 years agokate: add error and rune
Evan Shaw [Mon, 14 Nov 2011 19:16:06 +0000 (11:16 -0800)]
kate: add error and rune

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