1
0
mirror of https://github.com/golang/go synced 2024-10-04 14:41:25 -06:00
Commit Graph

4505 Commits

Author SHA1 Message Date
Robert Griesemer
d0b9a84ab3 go/ast: remove unused receiver names (cleanup)
R=iant, iant
CC=golang-dev
https://golang.org/cl/5393047
2011-11-16 13:41:26 -08:00
Gustavo Niemeyer
c9355596cd 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
2011-11-16 17:35:47 -02:00
Brad Fitzpatrick
881f2076fb 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
2011-11-16 10:11:39 -08:00
Rob Pike
f5db4d05f2 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
2011-11-16 09:32:52 -08:00
Dave Cheney
00f9b7680a 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
2011-11-16 10:19:56 -05:00
Andrew Balholm
3307597069 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
2011-11-16 19:25:55 +11:00
Andrew Balholm
28546ed56a 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
2011-11-16 12:18:11 +11:00
Yasuhiro Matsumoto
5e5c5c2789 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
2011-11-15 16:29:43 -08:00
Brad Fitzpatrick
5b7827ec07 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
2011-11-15 14:29:45 -08:00
Mikio Hara
471e43cf00 net, syscall: add missing copyright notices
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5375099
2011-11-16 06:59:08 +09:00
Russ Cox
3a6744d890 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
2011-11-15 14:54:00 -05:00
Russ Cox
86a6995a7e os: fix windows build
TBR=brainman
CC=golang-dev
https://golang.org/cl/5373105
2011-11-15 14:05:18 -05:00
Russ Cox
a6106eef37 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
2011-11-15 13:59:59 -05:00
Russ Cox
a3fb1aec6b 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
2011-11-15 13:09:19 -05:00
Alex Brainman
0d37998a06 syscall: make windows build again after d3963c0fca78 change
R=rsc, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5373097
2011-11-15 12:48:22 -05:00
Russ Cox
d03611f628 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
2011-11-15 12:20:59 -05:00
Russ Cox
0ed5e6a2be 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
2011-11-15 12:17:25 -05:00
Russ Cox
94c2536e3f runtime: avoid allocation for make([]T, 0)
R=gri, iant, iant
CC=golang-dev
https://golang.org/cl/5375093
2011-11-15 12:05:25 -05:00
Russ Cox
276473cd72 strconv: add Ftoa benchmarks
R=bradfitz
CC=golang-dev
https://golang.org/cl/5373096
2011-11-15 11:02:04 -05:00
Russ Cox
552a556a40 encoding/json: add marshal/unmarshal benchmark
R=bradfitz
CC=golang-dev
https://golang.org/cl/5387041
2011-11-15 10:58:19 -05:00
Mikio Hara
8998673cc6 net/http: fix build
empty is already not a nil.

R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5376099
2011-11-15 14:04:58 +09:00
Andrew Balholm
b91d82258f 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
2011-11-15 15:31:22 +11:00
Mikio Hara
a619da9f4a xml: fix build
empty is already not a nil.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5376098
2011-11-15 10:28:01 +09:00
Mikio Hara
301701d8a7 go/build: fix build
empty is already not a nil.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5375097
2011-11-15 10:27:43 +09:00
Andrew Balholm
3bd5082f57 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
2011-11-15 11:39:18 +11:00
Robert Griesemer
f5cf0a486e 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
2011-11-14 13:35:22 -08:00
Brad Fitzpatrick
4bd15ae1b7 cgi: make test code more readable
R=rsc
CC=golang-dev
https://golang.org/cl/5375089
2011-11-14 13:12:08 -08:00
Russ Cox
4e65478cbd reflect: empty slice/map is not DeepEqual to nil
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5373095
2011-11-14 16:11:15 -05:00
Russ Cox
a7f1e10d24 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
2011-11-14 16:10:58 -05:00
Russ Cox
53523f6a7d 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
2011-11-14 16:03:23 -05:00
Russ Cox
1df62ca638 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
2011-11-14 15:21:08 -05:00
Dmitriy Vyukov
ba98a7ee5e time: fix test hang
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5374083
2011-11-14 22:31:39 +03:00
Russ Cox
0acd879c26 syscall: take over env implementation
The environment is needed by package time, which
we want not to depend on os (so that os can use
time.Time), so push down into syscall.

Delete syscall.Sleep, now unnecessary.

The package os environment API is preserved;
it is only the implementation that is moving to syscall.

Delete os.Envs, which was undocumented,
uninitialized on Windows and Plan 9, and
not maintained by Setenv and Clearenv.
Code can call os.Environ instead.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5370091
2011-11-14 14:06:50 -05:00
Dmitriy Vyukov
dc6726b37f runtime: fix timers crash
Timer callbacks occasionally crash
with "sched while holding locks" message.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5381043
2011-11-14 21:59:48 +03:00
Brad Fitzpatrick
0a8005c772 sql: add DB.Close, fix bugs, remove Execer on Driver (only Conn)
R=rsc
CC=golang-dev
https://golang.org/cl/5372099
2011-11-14 10:48:26 -08:00
Russ Cox
869aabbdd0 syscall: more linux arm build fixes
Don't know if it runs, but at least it builds.

R=bradfitz
TBR=bradfitz
CC=golang-dev
https://golang.org/cl/5373093
2011-11-14 11:31:58 -05:00
Alex Brainman
946647fb45 runtime: fix syscall test to satisfy new error
R=rsc
CC=golang-dev
https://golang.org/cl/5369103
2011-11-14 20:54:47 +11:00
Russ Cox
45eef04ed4 syscall: fix linux arm build
Regenerate system call file.

TBR=bradfitz
CC=golang-dev
https://golang.org/cl/5371087
2011-11-14 01:23:27 -05:00
Russ Cox
6677d2954e syscall: make windows Errno implement net.Error (fix build)
TBR=brainman
CC=golang-dev
https://golang.org/cl/5371086
2011-11-14 01:21:38 -05:00
Mikio Hara
f19aef5393 syscall: regenerate z-files for freebsd
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5369102
2011-11-14 13:27:40 +09:00
Russ Cox
558e7fc332 various: avoid func compare
R=gri, r, bradfitz
CC=golang-dev
https://golang.org/cl/5371074
2011-11-13 22:57:19 -05:00
Russ Cox
c017a8299f syscall: use error
- syscall (not os) now defines the Errno type.
- the low-level assembly functions Syscall, Syscall6, and so on
  return Errno, not uintptr
- syscall wrappers all return error, not uintptr.

R=golang-dev, mikioh.mikioh, r, alex.brainman
CC=golang-dev
https://golang.org/cl/5372080
2011-11-13 22:44:52 -05:00
Russ Cox
b126902e84 time: remove unused sysSleep
R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/5369094
2011-11-13 22:42:57 -05:00
Russ Cox
fd34e78b53 various: reduce overuse of os.EINVAL + others
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5372081
2011-11-13 22:42:42 -05:00
Dave Cheney
7af553ab52 exp/ssh: add direct-tcpip client support
This CL adds experimental support for making proxied
net.Conn connections via the remote server.

nb. Functional tests exist for this feature but CL
5320053 or similar needs to be committed to support them.

R=rsc, agl, n13m3y3r
CC=cw, golang-dev, huin
https://golang.org/cl/5371081
2011-11-13 21:05:35 -05:00
Dave Cheney
34466a1491 exp/ssh: add client functional tests
Requires CL 5373055

R=rsc, agl, n13m3y3r
CC=golang-dev
https://golang.org/cl/5320053
2011-11-13 20:58:51 -05:00
Dave Cheney
59a92cde3d exp/ssh: use ClientConfig.rand() for publickey authentication
Closes TODO from 5373055

R=agl
CC=golang-dev
https://golang.org/cl/5375081
2011-11-13 20:57:15 -05:00
Dave Cheney
3ee171d174 exp/ssh: add client side support for publickey auth
client.go/client_auth.go:
* add support for publickey key auth using the interface
  outlined by rsc in the previous auth CL

client_auth_test.go:
* password and publickey tests against server.go

common.go/server.go:
* move some helper methods from server.go into common.go
* generalise serializeRSASignature

R=rsc, agl, huin
CC=cw, golang-dev, n13m3y3r
https://golang.org/cl/5373055
2011-11-13 14:48:22 -05:00
Dave Cheney
90ec203318 exp/ssh: ensure initial window advertisement is not lost
Some remote servers send a 0 window size in the channel
open confirm msg, others send a non zero window size. Make
sure this initial advertisement is not lost.

R=agl, rsc, cw
CC=golang-dev
https://golang.org/cl/5372083
2011-11-13 12:13:46 -05:00
Andrew Balholm
06ef97e15d html: auto-close <dd> and <dt> elements
Pass tests2.dat, test 8:
<!DOCTYPE html><dt><div><dd>

| <!DOCTYPE html>
| <html>
|   <head>
|   <body>
|     <dt>
|       <div>
|     <dd>

Also pass tests through test 9:
<script></x

R=nigeltao
CC=golang-dev
https://golang.org/cl/5373083
2011-11-13 23:27:20 +11:00