]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agohtml: implement fragment parsing algorithm
Andrew Balholm [Thu, 1 Dec 2011 01:47:57 +0000 (12:47 +1100)]
html: implement fragment parsing algorithm

Pass the tests in tests4.dat.

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

13 years agosyscall: fix openbsd sysctl hostname/domainname workaround
Joel Sing [Wed, 30 Nov 2011 23:17:33 +0000 (10:17 +1100)]
syscall: fix openbsd sysctl hostname/domainname workaround

Fixes #2509.

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

13 years agohtml/template: update to new template API
Rob Pike [Wed, 30 Nov 2011 22:42:18 +0000 (17:42 -0500)]
html/template: update to new template API

Not quite done yet but enough is here to review.

Embedding is eliminated so clients can't accidentally reach
methods of text/template.Template that would break the
invariants.

TODO later: Add and Clone are unimplemented.
TODO later: address issue 2349

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

13 years agoundo CL 5436056 / 03560deae933
Dave Cheney [Wed, 30 Nov 2011 22:14:03 +0000 (17:14 -0500)]
undo CL 5436056 / 03560deae933

Remove the accidentally exported net.Listener

««« original CL description
exp/ssh: remove unused forwarding methods in Server Listener

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

»»»

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

13 years agold: align ELF data sections
Ian Lance Taylor [Wed, 30 Nov 2011 21:24:16 +0000 (13:24 -0800)]
ld: align ELF data sections

fixes #2506

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

13 years agotime: fix windows build
Russ Cox [Wed, 30 Nov 2011 20:45:24 +0000 (15:45 -0500)]
time: fix windows build

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

13 years agomath: faster Sincos
Charles L. Dorian [Wed, 30 Nov 2011 20:11:44 +0000 (15:11 -0500)]
math: faster Sincos

Sincos via sincos.go is 35.4 ns/op, via sincos_amd64.s is 37.4 ns/op on 2.53 GHz Intel Core 2 Duo (Mac OS X).

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

13 years agoos: fix path/filepath test on Windows
Russ Cox [Wed, 30 Nov 2011 18:42:14 +0000 (13:42 -0500)]
os: fix path/filepath test on Windows

This is not the right fix, but it is what used to happen
before the FileInfo conversion, and it should get the
build working again (at least that part).

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

13 years agoencoding/asn1: fix test on OpenBSD
Russ Cox [Wed, 30 Nov 2011 18:36:25 +0000 (13:36 -0500)]
encoding/asn1: fix test on OpenBSD

time.Parse uses time.Local if it has the right zone offset,
otherwise it calls time.FixedZone.  The test's use of reflect.DeepEqual
meant that the test expected time.FixedZone always, failing
when the local time zone really would have used -0700 for
that time.  The fix is to format the time to display only the
pieces we intend to test.

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

13 years agoos: fix windows build
Russ Cox [Wed, 30 Nov 2011 17:38:54 +0000 (12:38 -0500)]
os: fix windows build

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

13 years agomath/big: fix destination leak into result value
Roger Peppe [Wed, 30 Nov 2011 17:29:58 +0000 (09:29 -0800)]
math/big: fix destination leak into result value
This code would panic:
z := big.NewInt(1)
z.SetBit(big.NewInt(0), 2, 1)
if z.Cmp(big.NewInt(1<<2)) != 0 {
        panic("fail")
}

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

13 years agoos: new FileInfo, FileMode types + update tree
Russ Cox [Wed, 30 Nov 2011 17:04:16 +0000 (12:04 -0500)]
os: new FileInfo, FileMode types + update tree

R=golang-dev, r, r, gri, bradfitz, iant, iant, nigeltao, n13m3y3r
CC=golang-dev
https://golang.org/cl/5416060

13 years agouse new time API
Russ Cox [Wed, 30 Nov 2011 17:01:46 +0000 (12:01 -0500)]
use new time API

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

13 years agotime: new Time, Duration, ZoneInfo types
Russ Cox [Wed, 30 Nov 2011 16:59:44 +0000 (11:59 -0500)]
time: new Time, Duration, ZoneInfo types

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

13 years agohtml: clean up the z.rawTag calculation in the tokenizer.
Nigel Tao [Wed, 30 Nov 2011 06:00:37 +0000 (17:00 +1100)]
html: clean up the z.rawTag calculation in the tokenizer.

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

13 years agohtml: parse <xmp> tags
Andrew Balholm [Wed, 30 Nov 2011 04:37:41 +0000 (15:37 +1100)]
html: parse <xmp> tags

Pass tests5.dat, test 10:
<p><xmp></xmp>

| <html>
|   <head>
|   <body>
|     <p>
|     <xmp>

Also pass the remaining tests in tests5.dat.

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

13 years agohtml: parse the contents of <iframe> elements as raw text
Andrew Balholm [Wed, 30 Nov 2011 00:44:54 +0000 (11:44 +1100)]
html: parse the contents of <iframe> elements as raw text

Pass tests5.dat, test 4:
<iframe> <!---> </iframe>x

| <html>
|   <head>
|   <body>
|     <iframe>
|       " <!---> "
|     "x"

Also pass tests through test 9:
<style> <!</-- </style>x

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

13 years agospec: update spacing to match gofmt, where reasonable.
David Symonds [Tue, 29 Nov 2011 23:47:36 +0000 (15:47 -0800)]
spec: update spacing to match gofmt, where reasonable.

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

13 years agoexp/ssh: Add Start(cmd string) and Signal(sig string) to Session. Rename Exec to...
Gustav Paul [Tue, 29 Nov 2011 17:26:39 +0000 (12:26 -0500)]
exp/ssh: Add Start(cmd string) and Signal(sig string) to Session. Rename Exec to Run.

Exec() has been renamed to Run() in keeping with the os/exec API.

Added func (*Session) Start(cmd string) which starts a remote process but unlike Run() doesn't wait for it to finish before returning.

Run() has been refactored to use Start internally. Its really just a refactoring, no new code but some extra functionality was won.

Also added func (*Session) Signal(sig signal) which sends a UNIX signal to a remote process. This is espcially useful in conjunction with Start() as the two allow you to start a remote process, monitor its stdout/stderr, and send it a TERM/HUP/etc signal when you want it to close.

R=dave, rsc, agl, bradfitz, n13m3y3r, gustavo
CC=golang-dev
https://golang.org/cl/5437058

13 years agocrypto/tls: add openbsd root certificate location
Joel Sing [Tue, 29 Nov 2011 14:20:59 +0000 (09:20 -0500)]
crypto/tls: add openbsd root certificate location

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

13 years agogc: move typedcl2 into export.c
Luuk van Dijk [Tue, 29 Nov 2011 12:34:08 +0000 (13:34 +0100)]
gc: move typedcl2 into export.c

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

13 years agodashboard: more tests, bug fixes, and /packages handler
Andrew Gerrand [Tue, 29 Nov 2011 08:24:57 +0000 (19:24 +1100)]
dashboard: more tests, bug fixes, and /packages handler

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

13 years agohtml: spin doctype.go out of parse.go.
Nigel Tao [Tue, 29 Nov 2011 07:20:59 +0000 (18:20 +1100)]
html: spin doctype.go out of parse.go.

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

13 years agocgo: fix incorrect print found by govet
Robert Hencke [Tue, 29 Nov 2011 03:40:34 +0000 (14:40 +1100)]
cgo: fix incorrect print found by govet

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

13 years agoruntime: make sure windows/amd64 stack is 16-byte aligned on syscall entry (fixes...
Alex Brainman [Tue, 29 Nov 2011 01:57:20 +0000 (12:57 +1100)]
runtime: make sure windows/amd64 stack is 16-byte aligned on syscall entry (fixes build)

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

13 years agohtml: detect quirks mode
Andrew Balholm [Tue, 29 Nov 2011 00:18:49 +0000 (11:18 +1100)]
html: detect quirks mode

Pass tests3.dat, test 23:
<p><table></table>

| <html>
|   <head>
|   <body>
|     <p>
|       <table>

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

13 years agosyscall: implement Syscall15
Alex Brainman [Mon, 28 Nov 2011 23:24:19 +0000 (10:24 +1100)]
syscall: implement Syscall15

Fixes #2251.

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

13 years agogoinstall: add -fix flag to run gofix on packages on build failure
Andrew Gerrand [Mon, 28 Nov 2011 22:28:58 +0000 (09:28 +1100)]
goinstall: add -fix flag to run gofix on packages on build failure
goinstall: better error handling and reporting

R=r, r, rsc, mattn.jp
CC=golang-dev
https://golang.org/cl/5421051

13 years agogc: remove funarg special case in structfield
Russ Cox [Mon, 28 Nov 2011 21:40:39 +0000 (16:40 -0500)]
gc: remove funarg special case in structfield

This should make CL 5431046 a little simpler.

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

13 years agomath: update special-conditions comments to use ± symbol
Charles L. Dorian [Mon, 28 Nov 2011 21:04:52 +0000 (13:04 -0800)]
math: update special-conditions comments to use ± symbol

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

13 years agoexp/ssh: move openChan to NewSession
Dave Cheney [Mon, 28 Nov 2011 20:42:47 +0000 (15:42 -0500)]
exp/ssh: move openChan to NewSession

openChan was only being called by NewSession, Dial has
its own version.

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

13 years agocrypto/tls: don't rely on map iteration order.
Adam Langley [Mon, 28 Nov 2011 20:34:16 +0000 (15:34 -0500)]
crypto/tls: don't rely on map iteration order.

Previously we were using the map iteration order to set the order of
the cipher suites in the ClientHello.

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

13 years agotext/template: address a couple of issues for html/template
Rob Pike [Mon, 28 Nov 2011 18:42:57 +0000 (10:42 -0800)]
text/template: address a couple of issues for html/template
- allow Lookup to work on uninitialized templates
- fix bug in add: can't error after parser is stopped
- add Add method for html/template

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

13 years agostrings: fix test output
Christopher Wedgwood [Mon, 28 Nov 2011 17:51:03 +0000 (09:51 -0800)]
strings: fix test output

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

13 years agobytes: fix test output
Christopher Wedgwood [Mon, 28 Nov 2011 17:50:51 +0000 (09:50 -0800)]
bytes: fix test output

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

13 years agodoc/tmptohtml: output fix
Christopher Wedgwood [Mon, 28 Nov 2011 17:50:40 +0000 (09:50 -0800)]
doc/tmptohtml: output fix

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

13 years agoexp/ssh: add safeString error sanitiser
Dave Cheney [Mon, 28 Nov 2011 17:29:19 +0000 (12:29 -0500)]
exp/ssh: add safeString error sanitiser

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

13 years agogc: don't inherit orig from subnodes in constant expression nodes.
Rémy Oudompheng [Mon, 28 Nov 2011 17:22:15 +0000 (12:22 -0500)]
gc: don't inherit orig from subnodes in constant expression nodes.

The wrong value made Nconv() show "1" for node "-1", and "2" from
node "2+3".
Fixes #2452.

R=gri, lvd, rsc
CC=golang-dev, remy
https://golang.org/cl/5435064

13 years agoexp/ssh: fix three shift bugs related to packet lengths
Dave Cheney [Mon, 28 Nov 2011 17:10:16 +0000 (12:10 -0500)]
exp/ssh: fix three shift bugs related to packet lengths

Thanks for Ke Lan for the initial report and investigation.

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

13 years agogc: fix copying of types
Maxim Pimenov [Mon, 28 Nov 2011 16:52:16 +0000 (11:52 -0500)]
gc: fix copying of types
reset xmethod during copytype

Fixes #2497

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

13 years agohttp: fix sniffing bug causing short writes
Brad Fitzpatrick [Mon, 28 Nov 2011 16:51:34 +0000 (11:51 -0500)]
http: fix sniffing bug causing short writes

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

13 years agoCONTRIBUTORS: add Maxim Pimenov (Google CLA)
Russ Cox [Mon, 28 Nov 2011 16:47:23 +0000 (11:47 -0500)]
CONTRIBUTORS: add Maxim Pimenov (Google CLA)

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

13 years agosql: add Tx.Stmt to use an existing prepared stmt in a transaction
Brad Fitzpatrick [Mon, 28 Nov 2011 16:00:32 +0000 (11:00 -0500)]
sql: add Tx.Stmt to use an existing prepared stmt in a transaction

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

13 years agoexp/ssh: fix misleading spelling mistake in comment
Gustav Paul [Mon, 28 Nov 2011 15:45:52 +0000 (10:45 -0500)]
exp/ssh: fix misleading spelling mistake in comment

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

13 years agofilepath/path: fix Rel buffer sizing
Gustavo Niemeyer [Mon, 28 Nov 2011 02:28:52 +0000 (21:28 -0500)]
filepath/path: fix Rel buffer sizing

Fixes #2493.

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

13 years agomath: fix typo in Log1p comments
Charles L. Dorian [Mon, 28 Nov 2011 02:01:08 +0000 (18:01 -0800)]
math: fix typo in Log1p comments

Also note the special case of -0.0.

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

13 years agohtml: parse <nobr> elements
Andrew Balholm [Sun, 27 Nov 2011 23:55:31 +0000 (10:55 +1100)]
html: parse <nobr> elements

Pass tests3.dat, test 20:
<!doctype html><nobr><nobr><nobr>

| <!DOCTYPE html>
| <html>
|   <head>
|   <body>
|     <nobr>
|     <nobr>
|     <nobr>

Also pass tests through test 22:
<!doctype html><html><body><p><table></table></body></html>

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

13 years agomath/big: use recursive subdivision for significant speedup
Michael T. Jones [Sun, 27 Nov 2011 19:10:59 +0000 (11:10 -0800)]
math/big: use recursive subdivision for significant speedup

This change adds the second aspect to the conversion code, the
use of large divisiors (powers of big base) to greatly speed up
the divsion of large numbers. Speedups of 30x are common in the
large cases. Also includes new tests and tuning code for the
key internal parameters.

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

13 years agoexp/ssh: messages now contain remote channel's id instead of local id
Gustav Paul [Sun, 27 Nov 2011 14:59:20 +0000 (09:59 -0500)]
exp/ssh: messages now contain remote channel's id instead of local id

According to http://www.ietf.org/rfc/rfc4254.txt most channel messages contain the channel id of the recipient channel, not the sender id. This allows the recipient connection multiplexer to route the message to the correct channel.

This changeset fixes several messages that incorrectly send the local channel id instead of the remote channel's id.

While sessions were being created and closed in sequence channels in the channel pool were freed and reused on the server side of the connection at the same rate as was done on the client, so the channel local and remote channel ids always corresponded. As soon as I had concurrent sessions on the same clientConn the server started to complain of 'uknown channel id N' where N is the local channel id, which is actually paired with server channel id K.

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

13 years agohtml: ignore <head> tags in <head> element
Andrew Balholm [Sun, 27 Nov 2011 03:41:08 +0000 (14:41 +1100)]
html: ignore <head> tags in <head> element

Pass tests3.dat, test 12:
<!DOCTYPE html><HTML><META><HEAD></HEAD></HTML>

| <!DOCTYPE html>
| <html>
|   <head>
|     <meta>
|   <body>

Also pass tests through test 19:
<!DOCTYPE html><html><head></head><body><ul><li><div><p><li></ul></body></html>

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

13 years agotext/template: rename the method Template.Template to Template.Lookup
Rob Pike [Sat, 26 Nov 2011 16:32:55 +0000 (08:32 -0800)]
text/template: rename the method Template.Template to Template.Lookup
Calling it Template makes it clumsy to embed the type, which html/template
depends on.

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

13 years agoos: fail if Open("") is called on windows
Alex Brainman [Sat, 26 Nov 2011 00:01:49 +0000 (11:01 +1100)]
os: fail if Open("") is called on windows

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

13 years agoexp/sql/driver: Correct package name in comment.
Benny Siegert [Fri, 25 Nov 2011 15:57:10 +0000 (10:57 -0500)]
exp/sql/driver: Correct package name in comment.

IIRC, package sql used to be called db. There was one occurrence
of the old name in a comment.

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

13 years agoC+A: add Gustav Paul (individual CLA)
Brad Fitzpatrick [Fri, 25 Nov 2011 15:50:19 +0000 (10:50 -0500)]
C+A: add Gustav Paul (individual CLA)

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

13 years agotime: fix timer stop
Dmitriy Vyukov [Fri, 25 Nov 2011 11:13:10 +0000 (14:13 +0300)]
time: fix timer stop
Due to data structure corruption,
some timers could not be removed.
Fixes #2495.

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

13 years agohtml/template: fix documentation indent
Andrew Gerrand [Fri, 25 Nov 2011 02:32:44 +0000 (13:32 +1100)]
html/template: fix documentation indent

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

13 years agodashboard: builder-facing implementation and tests
Andrew Gerrand [Fri, 25 Nov 2011 01:53:05 +0000 (12:53 +1100)]
dashboard: builder-facing implementation and tests

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

13 years agotext/template: fix bug in Clone
Rob Pike [Fri, 25 Nov 2011 00:07:19 +0000 (16:07 -0800)]
text/template: fix bug in Clone
Cloned template copied the root template incorrectly.
Add test of self-consistency.

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

13 years agoeffective_go: remove unused variable from a couple of examples
Rob Pike [Thu, 24 Nov 2011 16:51:47 +0000 (08:51 -0800)]
effective_go: remove unused variable from a couple of examples
Fixes #2481.

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

13 years agostrings: Add ContainsAny and ContainsRune to correspond to IndexAny etc.
Scott Lawrence [Thu, 24 Nov 2011 04:20:14 +0000 (20:20 -0800)]
strings: Add ContainsAny and ContainsRune to correspond to IndexAny etc.

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

13 years agogofix: trivial rewrite for template.ParseFiles
Rob Pike [Thu, 24 Nov 2011 04:17:41 +0000 (20:17 -0800)]
gofix: trivial rewrite for template.ParseFiles
Also warn about uses of Set.

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

13 years agotext/template: new, simpler API
Rob Pike [Thu, 24 Nov 2011 04:17:22 +0000 (20:17 -0800)]
text/template: new, simpler API

The Set type is gone. Instead, templates are automatically associated by
being parsed together; nested definitions implicitly create associations.
Only associated templates can invoke one another.

This approach dramatically reduces the breadth of the construction API.

For now, html/template is deleted from src/pkg/Makefile, so this can
be checked in. Nothing in the tree depends on it. It will be updated next.

R=dsymonds, adg, rsc, r, gri, mikesamuel, nigeltao
CC=golang-dev
https://golang.org/cl/5415060

13 years agohtml: ingore newline at the start of a <pre> block
Andrew Balholm [Thu, 24 Nov 2011 02:15:09 +0000 (13:15 +1100)]
html: ingore newline at the start of a <pre> block

Pass tests3.dat, test 4:
<!DOCTYPE html><html><head></head><body><pre>\n</pre></body></html>

| <!DOCTYPE html>
| <html>
|   <head>
|   <body>
|     <pre>

Also pass tests through test 11:
<!DOCTYPE html><pre>&#x0a;&#x0a;A</pre>

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

13 years agogo/ast: trivial cleanup (remove superfluous string conversion)
Robert Griesemer [Thu, 24 Nov 2011 00:20:55 +0000 (16:20 -0800)]
go/ast: trivial cleanup (remove superfluous string conversion)

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

13 years agohtml: parse DOCTYPE into name and public and system identifiers
Andrew Balholm [Wed, 23 Nov 2011 22:28:58 +0000 (09:28 +1100)]
html: parse DOCTYPE into name and public and system identifiers

Pass tests2.dat, test 59:
<!DOCTYPE <!DOCTYPE HTML>><!--<!--x-->-->

| <!DOCTYPE <!doctype>
| <html>
|   <head>
|   <body>
|     ">"
|     <!-- <!--x -->
|     "-->"

Pass all the tests in doctype01.dat.

Also pass tests2.dat, test 60:
<!doctype html><div><form></form><div></div></div>

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

13 years agogo/printer, gofmt: more performance tweaks
Robert Griesemer [Wed, 23 Nov 2011 17:27:38 +0000 (09:27 -0800)]
go/printer, gofmt: more performance tweaks

Removed more string conversions and streamlined bottleneck
printing interface by removing unnecessary tests where possible.
About 6% faster AST printing.

Before:
- printer.BenchmarkPrint 50 32056640 ns/op

After:
- printer.BenchmarkPrint 50 30138440 ns/op (-6%)

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

13 years agofmt: don't check for nil when printing arrays as Go syntax.
Rémy Oudompheng [Wed, 23 Nov 2011 17:04:02 +0000 (09:04 -0800)]
fmt: don't check for nil when printing arrays as Go syntax.

Also add array values to printing test suite.
Fixes #2468.

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

13 years agocrypto/openpgp/packet: fix private key checksum
Adam Langley [Wed, 23 Nov 2011 14:44:29 +0000 (09:44 -0500)]
crypto/openpgp/packet: fix private key checksum

I misinterpreted http://tools.ietf.org/html/rfc4880#section-5.5.3
and implemented the sum of 16-bit values, rather than the 16-bit sum
of 8-bit values.

Thanks to Szabolcs Nagy for pointing it out.

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

13 years agoexp/ssh: add simple tcpip.go functional tests
Dave Cheney [Wed, 23 Nov 2011 14:38:11 +0000 (09:38 -0500)]
exp/ssh: add simple tcpip.go functional tests

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

13 years agoexp/ssh: remove unused forwarding methods in Server Listener
Dave Cheney [Wed, 23 Nov 2011 14:35:01 +0000 (09:35 -0500)]
exp/ssh: remove unused forwarding methods in Server Listener

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

13 years agogo/printer: remove "written" result value - is never used
Robert Griesemer [Tue, 22 Nov 2011 23:27:10 +0000 (15:27 -0800)]
go/printer: remove "written" result value - is never used

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

13 years agogo/printer, gofmt: 20 to 30% faster gofmt
Robert Griesemer [Tue, 22 Nov 2011 23:12:34 +0000 (15:12 -0800)]
go/printer, gofmt: 20 to 30% faster gofmt

Buffer intermediate output via a bytes.Buffer and thus avoid
calling through the entire Writer stack for every item printed.
There is more opportunity for improvements along the same lines.

Before (best of 3 runs):
- printer.BenchmarkPrint       50   47959760 ns/op
- time gofmt -l $GOROOT/src       real   0m11.517s

After (best of 3 runs):
- printer.BenchmarkPrint       50   32056640 ns/op (= -33%)
- time gofmt -l $GOROOT/src       real   0m9.070s       (= -21%)

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

13 years agohtml: on EOF in a comment, ignore final dashes (up to 2)
Andrew Balholm [Tue, 22 Nov 2011 22:26:37 +0000 (09:26 +1100)]
html: on EOF in a comment, ignore final dashes (up to 2)

Pass tests2.dat, test 57:
<!DOCTYPE html><!--x--

| <!DOCTYPE html>
| <!-- x -->
| <html>
|   <head>
|   <body>

Also pass test 58:
<!DOCTYPE html><table><tr><td></p></table>

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

13 years agodashboard: new Go dashboard data structure design
Andrew Gerrand [Tue, 22 Nov 2011 21:13:05 +0000 (08:13 +1100)]
dashboard: new Go dashboard data structure design

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

13 years agotutorial: update go_tutorial.html
Rob Pike [Tue, 22 Nov 2011 19:53:30 +0000 (11:53 -0800)]
tutorial: update go_tutorial.html
There's version skew with respect to the programs in doc/progs.

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

13 years agoencoding/xml: fix copy bug
Russ Cox [Tue, 22 Nov 2011 17:31:33 +0000 (12:31 -0500)]
encoding/xml: fix copy bug

Fixes #2484.

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

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