1
0
mirror of https://github.com/golang/go synced 2024-10-04 16:11:21 -06:00
Commit Graph

3084 Commits

Author SHA1 Message Date
Brad Fitzpatrick
81cfb4ec2b http: fix FileServer's default text content type
Fixes #1729

R=rsc, adg
CC=golang-dev
https://golang.org/cl/4443057
2011-04-22 09:09:37 -07:00
Ian Lance Taylor
75ca6d189c http/cgi: copy some PATH environment variables to child
R=bradfitz, bradfitzwork, iant2, bradfitzgo
CC=golang-dev
https://golang.org/cl/4444058
2011-04-22 08:53:52 -07:00
Alex Brainman
59c18b0b36 os: Open with O_APPEND|O_CREATE to append to the end of file on Windows
Credit for the fix goes to Hector, test by PeterGo.

Fixes #1655.

R=golang-dev, rsc1, peterGo
CC=golang-dev, hector
https://golang.org/cl/4436051
2011-04-22 15:31:25 +10:00
Brad Fitzpatrick
8d6a12f570 http: clarify docs on Request HTTP version
Fixes #910

R=adg, rsc1
CC=golang-dev
https://golang.org/cl/4439062
2011-04-21 19:57:19 -07:00
Brad Fitzpatrick
750b6c63f9 http: close underlying gzip Reader too
Fixes #1724

R=rsc
CC=golang-dev
https://golang.org/cl/4443056
2011-04-21 16:01:29 -07:00
Brad Fitzpatrick
a1f5f3f109 xml: Parser hook for non-UTF-8 charset converters
Adds an optional hook to Parser to let charset
converters step in when a processing directive
with a non-UTF-8 encoding is specified.

(Open to alternative proposals too...)

R=rsc
CC=golang-dev
https://golang.org/cl/4437061
2011-04-21 14:37:26 -07:00
Mikio Hara
380f4ab2ff syscall: add BPF support for darwin/386, darwin/amd64
note: due to issue 1466 the Msghdr and BpfProgram
struct for src/pkg/syscall/ztypes_darwin_386.go,
src/pkg/syscall/ztypes_darwin_amd64.go had to be
edited after the godefs generation.

R=rsc
CC=golang-dev
https://golang.org/cl/4403042
2011-04-21 16:58:20 -04:00
Brad Fitzpatrick
ee154f5df5 mime/multipart: limit line length to prevent abuse
Fixes #1528

R=rsc
CC=golang-dev
https://golang.org/cl/4425060
2011-04-21 10:45:49 -07:00
Dmitriy Vyukov
29d78f1243 runtime: fix GOMAXPROCS vs garbage collection bug
Fixes #1715.

R=golang-dev, rsc1, rsc
CC=golang-dev
https://golang.org/cl/4434053
2011-04-21 12:09:25 -04:00
Ian Lance Taylor
1f09cc25a1 runtime: skip functions with no lines when building src line table
Avoid getting out of synch when a function, such as main.init,
has no associated line number information.  Without this the
function before main.init can skip the PC all the way to the
next function, which will cause the next function's line table
to be associated with main.init, and leave subsequent
functions with the wrong line numbers.

R=rsc
CC=golang-dev
https://golang.org/cl/4426055
2011-04-21 08:32:58 -07:00
Albert Strasheim
946a4ea0e3 syscall: Madvise and Mprotect for Linux.
R=rsc
CC=golang-dev
https://golang.org/cl/4369047
2011-04-21 10:23:11 -04:00
Dmitry Chestnykh
a260de44e9 net: try /etc/hosts before loading DNS config.
On Mac X 10.6 /etc/resolv.conf is changed dynamically,
and may not exist at all when all network connections
are turned off, thus any lookup, even for "localhost"
would fail with "error reading DNS config: open
/etc/resolv.conf: no such file or directory". This
change avoids the error by trying to lookup addresses
in /etc/hosts before loading DNS config.

R=golang-dev, rsc1, rsc
CC=golang-dev
https://golang.org/cl/4431054
2011-04-21 10:23:03 -04:00
Mikio Hara
338b7abdfc net: fix EAI_BADFLAGS error on freebsd
R=rsc
CC=golang-dev
https://golang.org/cl/4442072
2011-04-21 10:22:53 -04:00
Vincent Vanackere
1f59004511 syscall : add a field to ProcAttr so that StartProcess can hide the executed application on windows
The SW_HIDE parameter looks like the only way for a windows GUI application to execute a CLI subcommand without having a shell windows appearing.

R=brainman, golang-dev, bradfitzgo, rsc1
CC=golang-dev
https://golang.org/cl/4439055
2011-04-22 00:12:06 +10:00
Russ Cox
5ff3336490 gc: correct handling of unexported method names in embedded interfaces
go/types: update for export data format change
reflect: require package qualifiers to match during interface check
runtime: require package qualifiers to match during interface check
test: fixed bug324, adapt to be silent

Fixes #1550.
Issue 1536 remains open.

R=gri, ken2, r
CC=golang-dev
https://golang.org/cl/4442071
2011-04-21 08:14:50 -04:00
Alex Brainman
5aad514674 syscall: correct Windows CreateProcess input parameters
Fixes #1718.

R=golang-dev, rsc, peterGo, r
CC=golang-dev
https://golang.org/cl/4435059
2011-04-21 10:36:27 +10:00
Rob Pike
c4cc9c282f gob: have errorf always prefix the message with "gob: "
to regularize the errors.

R=rsc
CC=golang-dev
https://golang.org/cl/4446055
2011-04-20 14:22:52 -07:00
Russ Cox
6e928e411b net: fix windows build
TBR=r
CC=golang-dev
https://golang.org/cl/4425059
2011-04-20 17:11:25 -04:00
Rob Pike
220f83134a gob: use new Implements and AssignableTo methods in reflect
to improve the code and removea  TODO.

R=rsc
CC=golang-dev
https://golang.org/cl/4443054
2011-04-20 14:07:13 -07:00
Brad Fitzpatrick
8dad7fec1d http: don't proxy loopback addresses
Fixes #1589

R=rsc
CC=golang-dev
https://golang.org/cl/4443053
2011-04-20 13:53:34 -07:00
Russ Cox
e1ee3b5db6 reflect: add Type.Implements, Type.AssignableTo, Value.CallSlice; make Set match Go
This CL makes reflect require that values be assignable to the target type
in exactly the same places where that is the rule in Go.  It also adds
the Implements and AssignableTo methods so that callers can check
the types themselves so as to avoid a panic.

Before this CL, reflect required strict type identity.

This CL expands Call to accept and correctly marshal arbitrary
argument lists for variadic functions; it introduces CallSlice for use
in the case where the slice for the variadic argument is already known.

Fixes #327.
Fixes #1212.

R=r, dsymonds
CC=golang-dev
https://golang.org/cl/4439058
2011-04-20 16:24:45 -04:00
Russ Cox
c9164a5d77 net: use C library resolver on FreeBSD, Linux, OS X / amd64, 386
This CL makes it possible to resolve DNS names on OS X
without offending the Application-Level Firewall.

It also means that cross-compiling from one operating
system to another is no longer possible when using
package net, because cgo needs to be able to sniff around
the local C libraries.  We could special-case this one use
and check in generated files, but it seems more trouble
than it's worth.  Cross compiling is dead anyway.

It is still possible to use either GOARCH=amd64 or GOARCH=386
on typical Linux and OS X x86 systems.

It is also still possible to build GOOS=linux GOARCH=arm on
any system, because arm is for now excluded from this change
(there is no cgo for arm yet).

R=iant, r, mikioh
CC=golang-dev
https://golang.org/cl/4437053
2011-04-20 15:21:59 -04:00
Russ Cox
64787e3123 reflect: update CanAddr, CanSet documentation
CanAddr was wrong, out of date; CanSet was incomplete.

R=r
CC=golang-dev
https://golang.org/cl/4442066
2011-04-20 15:04:04 -04:00
Nigel Tao
6a186d38d1 src/pkg: make package doc comments consistently start with "Package foo".
R=rsc
CC=golang-dev
https://golang.org/cl/4442064
2011-04-20 09:57:05 +10:00
Rob Pike
3cb973ff65 gob: fix trivial bug in map marshaling.
Forgot to send key/value types.

R=rsc
CC=golang-dev, hmc2you
https://golang.org/cl/4434058
2011-04-19 10:41:12 -07:00
Adam Langley
b8df1465cc crypto/openpgp: better handling of keyrings.
* Accept armored private key blocks
  * If an armored block is missing, return an InvalidArgumentError,
    rather than ignoring it.
  * If every key in a block is skipped due to being unsupported,
    return the last unsupported error.
  * Include the numeric type of unsupported public keys.
  * Don't assume that the self-signature comes immediately after the
    user id packet.

R=bradfitzgo
CC=golang-dev
https://golang.org/cl/4434048
2011-04-19 11:00:35 -04:00
Adam Langley
90d3837193 crypto/x509: fix build
This pulls in changes that should have been in 3faf9d0c10c0, but
weren't because x509.go was part of another changelist.

TBR=bradfitzgo

R=bradfitzgo
CC=golang-dev
https://golang.org/cl/4433056
2011-04-19 10:11:37 -04:00
Adam Langley
c24c6d8340 crypto: move certificate verification into x509.
People have a need to verify certificates in situations other than TLS
client handshaking. Thus this CL moves certificate verification into
x509 and expands its abilities.

R=bradfitzgo
CC=golang-dev
https://golang.org/cl/4407046
2011-04-19 09:57:58 -04:00
Nigel Tao
5500f027f7 image/jpeg: add an encoder.
It is based on changeset 4186064 by Raph Levien <raph@google.com>.

R=r, nigeltao_gnome
CC=golang-dev
https://golang.org/cl/4435051
2011-04-19 11:00:47 +10:00
Russ Cox
3bac16a6bf reflect: allow Slice of arrays
R=r
CC=golang-dev
https://golang.org/cl/4444049
2011-04-18 20:00:42 -04:00
Russ Cox
857f17d346 http: fix IP confusion in TestServerTimeouts
Don't assume that localhost == 127.0.0.1.
It might be ::1.

R=bradfitzgo
CC=golang-dev
https://golang.org/cl/4430055
2011-04-18 16:03:24 -04:00
Russ Cox
cded21a337 changes for more restricted reflect.SetValue
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4423043
2011-04-18 14:36:22 -04:00
Russ Cox
40fccbce6b reflect: more efficient; cannot Set result of NewValue anymore
* Reduces malloc counts during gob encoder/decoder test from 6/6 to 3/5.

The current reflect uses Set to mean two subtly different things.

(1) If you have a reflect.Value v, it might just represent
itself (as in v = reflect.NewValue(42)), in which case calling
v.Set only changed v, not any other data in the program.

(2) If you have a reflect Value v derived from a pointer
or a slice (as in x := []int{42}; v = reflect.NewValue(x).Index(0)),
v represents the value held there.  Changing x[0] affects the
value returned by v.Int(), and calling v.Set affects x[0].

This was not really by design; it just happened that way.

The motivation for the new reflect implementation was
to remove mallocs.  The use case (1) has an implicit malloc
inside it.  If you can do:

       v := reflect.NewValue(0)
       v.Set(42)
       i := v.Int()  // i = 42

then that implies that v is referring to some underlying
chunk of memory in order to remember the 42; that is,
NewValue must have allocated some memory.

Almost all the time you are using reflect the goal is to
inspect or to change other data, not to manipulate data
stored solely inside a reflect.Value.

This CL removes use case (1), so that an assignable
reflect.Value must always refer to some other piece of data
in the program.  Put another way, removing this case would
make

       v := reflect.NewValue(0)
       v.Set(42)

as illegal as

       0 = 42.

It would also make this illegal:

       x := 0
       v := reflect.NewValue(x)
       v.Set(42)

for the same reason.  (Note that right now, v.Set(42) "succeeds"
but does not change the value of x.)

If you really wanted to make v refer to x, you'd start with &x
and dereference it:

       x := 0
       v := reflect.NewValue(&x).Elem()  // v = *&x
       v.Set(42)

It's pretty rare, except in tests, to want to use NewValue and then
call Set to change the Value itself instead of some other piece of
data in the program.  I haven't seen it happen once yet while
making the tree build with this change.

For the same reasons, reflect.Zero (formerly reflect.MakeZero)
would also return an unassignable, unaddressable value.
This invalidates the (awkward) idiom:

       pv := ... some Ptr Value we have ...
       v := reflect.Zero(pv.Type().Elem())
       pv.PointTo(v)

which, when the API changed, turned into:

       pv := ... some Ptr Value we have ...
       v := reflect.Zero(pv.Type().Elem())
       pv.Set(v.Addr())

In both, it is far from clear what the code is trying to do.  Now that
it is possible, this CL adds reflect.New(Type) Value that does the
obvious thing (same as Go's new), so this code would be replaced by:

       pv := ... some Ptr Value we have ...
       pv.Set(reflect.New(pv.Type().Elem()))

The changes just described can be confusing to think about,
but I believe it is because the old API was confusing - it was
conflating two different kinds of Values - and that the new API
by itself is pretty simple: you can only Set (or call Addr on)
a Value if it actually addresses some real piece of data; that is,
only if it is the result of dereferencing a Ptr or indexing a Slice.

If you really want the old behavior, you'd get it by translating:

       v := reflect.NewValue(x)

into

       v := reflect.New(reflect.Typeof(x)).Elem()
       v.Set(reflect.NewValue(x))

Gofix will not be able to help with this, because whether
and how to change the code depends on whether the original
code meant use (1) or use (2), so the developer has to read
and think about the code.

You can see the effect on packages in the tree in
https://golang.org/cl/4423043/.

R=r
CC=golang-dev
https://golang.org/cl/4435042
2011-04-18 14:35:33 -04:00
Brad Fitzpatrick
6211b596d6 mime: add a TODO, fix the format of an error
R=r, rsc1
CC=golang-dev
https://golang.org/cl/4440054
2011-04-18 11:21:16 -07:00
Brad Fitzpatrick
98176b7760 mime: RFC 2231 continuation / non-ASCII support
Fixes #1119.

R=rsc, r
CC=golang-dev
https://golang.org/cl/4437052
2011-04-18 10:59:39 -07:00
Quan Yong Zhai
f80f97a351 net: fix dialgoogle_test.go
~$ nslookup www.google.com
Server: 8.8.8.8
cannonical name = www-g-com-chn.l.google.com.

R=adg, rsc
CC=golang-dev
https://golang.org/cl/4445045
2011-04-18 11:19:47 -04:00
Russ Cox
90d8c8a09f runtime: fix arm5 softfloat
R=dfc, ken2, rsc
CC=golang-dev
https://golang.org/cl/4446043
2011-04-17 14:16:26 -04:00
Dave Cheney
a58fe3bd23 websocket: fix socket leak in test
Possibly fixes issue 1694.

R=bradfitzgo
CC=golang-dev
https://golang.org/cl/4427049
2011-04-17 09:43:27 -07:00
Brad Fitzpatrick
90e4ece365 mime: bunch more tests, few minor parsing fixes
Working towards issue 1119

Using test data from http://greenbytes.de/tech/tc2231/

R=r
CC=golang-dev
https://golang.org/cl/4430049
2011-04-15 16:33:52 -07:00
Ross Light
bfb486875a compress/zlib: add FDICT flag in Reader/Writer
R=bradfitzgo, rsc, bradfitzwork
CC=golang-dev
https://golang.org/cl/4406046
2011-04-15 15:32:03 -07:00
Brad Fitzpatrick
4787e70b7b http: handler timeout support
Fixes #213

R=r, rsc
CC=golang-dev
https://golang.org/cl/4432043
2011-04-15 12:53:32 -07:00
Russ Cox
b7065c5da4 net: disable one more external network test
R=golang-dev, r2
CC=golang-dev
https://golang.org/cl/4442042
2011-04-15 11:21:29 -04:00
Brad Fitzpatrick
9b8d4e0977 json: keep track of error offset in SyntaxError
R=rsc
CC=golang-dev
https://golang.org/cl/4430043
2011-04-15 08:14:34 -07:00
Brad Fitzpatrick
e806565626 http: reverse proxy handler
R=rsc, petar-m
CC=golang-dev
https://golang.org/cl/4428041
2011-04-15 08:13:52 -07:00
Ian Lance Taylor
a696da10e0 gob: when decoding a string, allocate a string, not a []byte.
R=r, r2
CC=golang-dev
https://golang.org/cl/4430042
2011-04-15 06:49:39 -07:00
Russ Cox
4c9634fc5b build: remove DISABLE_NET_TESTS
Don't use external network during all.bash.

R=r, r2, rh, ality
CC=golang-dev
https://golang.org/cl/4429041
2011-04-15 08:20:42 -04:00
David Symonds
57d0c26c01 expvar: add Func for functions that return values that are JSON marshalable.
Remove {Float,Int,String}Func, which are now redundant.

Fixes #1684.

R=rsc, r, r2
CC=golang-dev
https://golang.org/cl/4410041
2011-04-15 01:21:18 -07:00
Russ Cox
6ca71fb897 os: turn EPIPE exit into panic
R=iant, r2
CC=golang-dev
https://golang.org/cl/4427042
2011-04-15 00:01:29 -04:00
Quan Yong Zhai
c09af6631f net: fix ParseIP
Fixes #1695.

R=golang-dev, rsc
CC=golang-dev, r
https://golang.org/cl/4418042
2011-04-14 23:49:51 -04:00
Brad Fitzpatrick
71f9dc2cea http: add NewRequest helper
NewRequest will save a lot of boilerplate code.

This also updates some docs on Request.Write and
adds some tests.

R=rsc, petar-m, r
CC=golang-dev
https://golang.org/cl/4406047
2011-04-14 20:36:52 -07:00
Rob Pike
c94f5fb0ba gob: fix handling of indirect receivers for GobDecoders.
The previous code was just wrong. Let's not talk about it.
Passes iant's new test.

R=rsc, iant, iant2
CC=golang-dev
https://golang.org/cl/4396053
2011-04-14 17:26:12 -07:00
Ian Lance Taylor
17bd39e7d9 gob: test case for indirection to large field.
R=r
CC=golang-dev
https://golang.org/cl/4404048
2011-04-14 17:16:26 -07:00
Petar Maymounkov
8b35293070 http: don't quote Set-Cookie Domain and Path
Fixes #1659

R=rsc, bradfitzgo, bradfitzwork
CC=bradfitz, golang-dev
https://golang.org/cl/4368052
2011-04-14 15:05:02 -07:00
Brad Fitzpatrick
881b1b4a02 http: be clear when failing to connect to a proxy
Ubuntu and/or GNOME have some bug that likes
to set the "http_proxy" environment variable
and forgets to unset it.  This is annoying
to debug.  Be clear in the error message that
a proxy was in use.

R=rsc
CC=golang-dev
https://golang.org/cl/4409045
2011-04-14 13:49:19 -07:00
Lucio De Re
ceef10c222 pkg/runtime/plan9: Warning remediation, for Plan 9 native.
. Missing declaration of runtime.brk_();
. Argument v in runtime.SysReserve() is not used;
  (I'd prefer a Plan 9-type solution...)

R=golang-dev, r, r2
CC=golang-dev
https://golang.org/cl/4368076
2011-04-14 11:54:36 -07:00
Adam Langley
6f921f22ae crypto/tls: add server-side OCSP stapling support.
We already had support on the client side. I also changed the name of
the flag in the ServerHello structure to match the name of the same
flag in the ClientHello (ocspStapling).

R=bradfitzgo
CC=golang-dev
https://golang.org/cl/4408044
2011-04-14 14:47:28 -04:00
Brad Fitzpatrick
e27702545a http: consume request bodies before replying
This fixes our http behavior (even if Handlers forget to
consume a request body, we do it for them before we send
their response header), fixes the racy TestServerExpect,
and adds TestServerConsumesRequestBody.

With GOMAXPROCS>1, the http tests now seem race-free.

R=rsc
CC=golang-dev
https://golang.org/cl/4419042
2011-04-14 10:40:23 -07:00
Brad Fitzpatrick
e0533b044d http: fix race in transport_test
R=rsc
CC=golang-dev
https://golang.org/cl/4414044
2011-04-14 09:07:20 -07:00
Russ Cox
36713a2a53 compress/flate: dictionary support
R=bradfitzwork
CC=golang-dev
https://golang.org/cl/4397043
2011-04-14 10:41:55 -04:00
Luuk van Dijk
dd93df35b9 runtime: fix gdb support for channels.
R=rsc
CC=golang-dev
https://golang.org/cl/4418043
2011-04-14 15:32:20 +02:00
Dave Cheney
9c3ecb3617 runtime: fix set and not used in chan.c
R=rsc
CC=golang-dev
https://golang.org/cl/4416042
2011-04-14 08:16:40 -04:00
Russ Cox
507df959e4 runtime: drop chan circular linked list in favor of circular buffer
The list elements are already being allocated out of a
single memory buffer.  We can drop the Link* pointer
following and the memory it requires, replacing it with
index operations.

The change also keeps a channel from containing a pointer
back into its own allocation block, which would create a
cycle.  Blocks involved in cycles are not guaranteed to be
finalized properly, and channels depend on finalizers to
free OS-level locks on some systems.  The self-reference
was keeping channels from being garbage collected.

runtime-gdb.py will need to be updated in order to dump
the content of buffered channels with the new data structure.

Fixes #1676.

R=ken2, r
CC=golang-dev
https://golang.org/cl/4411045
2011-04-13 23:42:06 -04:00
Russ Cox
4c006182dc pkg: manual cleanup of some gofixed code
R=golang-dev, niemeyer, r
CC=golang-dev
https://golang.org/cl/4372052
2011-04-13 23:36:00 -04:00
Corey Thomasson
785fbd94fd net: sort records returned by LookupMX
R=rog, adg, rsc
CC=golang-dev
https://golang.org/cl/4388048
2011-04-14 10:30:56 +10:00
Nigel Tao
4c60569e7c image: allow "?" wildcards when registering image formats.
R=r, nigeltao_gnome
CC=golang-dev
https://golang.org/cl/4404041
2011-04-14 09:56:42 +10:00
Robert Griesemer
a2e286828b gofmt: gofmt -s -w src misc
R=r, bradfitzwork
CC=golang-dev
https://golang.org/cl/4406044
2011-04-13 15:13:59 -07:00
Robert Griesemer
5666ec8735 fix build: disable gofmt test script, enable gotest testing instead
R=rsc
CC=golang-dev
https://golang.org/cl/4403045
2011-04-13 14:24:38 -07:00
Brad Fitzpatrick
c7d16cc411 http: flesh out server Expect handling + tests
This mostly adds Expect 100-continue tests (from
the perspective of server correctness) that were
missing before.

It also fixes a few missing cases that will
probably never come up in practice, but it's nice
to have handled correctly.

Proper 100-continue client support remains a TODO.

R=rsc, bradfitzwork
CC=golang-dev
https://golang.org/cl/4399044
2011-04-13 14:09:04 -07:00
Russ Cox
7b6ee1a5d4 reflect: inline method implementations
This CL is only cut-and-paste, moving code around.
Moving it in a separate CL should simplify the diffs in later CLs.

There are three patterns here.

1. A function like
        func (v Value) M() (...) {
                return v.panicIfNot(K).(*kValue).M()
        }
becomes
        func (v Value) M() (...) {
                vv := v.panicIfNot(K).(*kValue)

                // body of (*kValue).M, s/v./vv./g
        }

2. A function like
        func (v Value) M() (...) {
                return v.panicIfNots(kList).(mer).M()
        }
becomes
        func (v Value) M() (...) {
                switch vv := v.panicIfNots(kList).(type) {
                case *k1Value:
                        // body of (*k1Value).M, s/v./vv./g
                case *k2Value:
                        // body of (*k2Value).M, s/v./vv./g
                ...
                }
                panic("not reached")
        }

3. The rewrite of Value.Set follows 2, but each case
is built from the bodies of (*kValue).SetValue and (*kValue).Set.
        func (v *kValue) SetValue(x Value) {
                v.Set(x.panicIfNot(K).(*kValue)
        }
        func (v *kValue) Set(x *kValue) {
                ... body
        }
becomes, in the switch from 2,
                case *kValue:
                        xx := x.panicIfNot(K).(*kValue)
                        ... body, s/v./vv./g; s/x./xx./g

R=r
CC=golang-dev
https://golang.org/cl/4398044
2011-04-13 16:55:20 -04:00
Russ Cox
1499c78281 build: tidy intermediate files during build
This CL changes the behavior of 'make install' and 'make test'
in the src/cmd directory and the src/pkg directory to have
each recursive make clean up after itself immediately.

It does the same in test/run, removing $F.$A and $A.out
(the common byproducts) between runs.

On machines with slow disks and aggressive kernel caching,
cleaning up immediately can mean that the intermediate
objects never get written to disk.

This change eliminates almost all the disk waiting during
all.bash on my laptop (a Thinkpad X201s with an SSD running Linux).

147.50u 19.95s 277.34r	before
148.53u 21.64s 179.59r	after

R=golang-dev, r, iant2
CC=golang-dev
https://golang.org/cl/4413042
2011-04-13 16:24:57 -04:00
Russ Cox
da8c5e7239 os/inotify: use _test for test files, not _obj
R=golang-dev, r, iant2
CC=golang-dev
https://golang.org/cl/4408043
2011-04-13 16:17:49 -04:00
Adam Langley
6392fc75cf bufio: add ReadLine
It matches encoding/line exactly and the tests are copied from there.
If we land this, then encoding/line will get marked as deprecated then
deleted in time.

R=rsc, rog, peterGo
CC=golang-dev
https://golang.org/cl/4389046
2011-04-13 15:12:28 -04:00
Brad Fitzpatrick
0be2ef3fc4 io: clarify that ReadAt shouldn't move the seek offset
R=r, mkrautz, r2, rsc
CC=golang-dev
https://golang.org/cl/4415041
2011-04-13 11:18:38 -07:00
Robert Griesemer
7c270aef08 go/ast: fixed bug in NotNilFilter, added test
- fixed a couple of comments
- cleanups after reflect change

R=rsc
CC=golang-dev
https://golang.org/cl/4389041
2011-04-13 09:37:13 -07:00
David Symonds
1de71a07e0 archive/tar: fix example's handling of os.EOF.
Fixes #1677.

R=r
CC=golang-dev
https://golang.org/cl/4402042
2011-04-13 10:56:33 +10:00
Fazlul Shahriar
08b0927771 os: fix Readdir in Plan 9
'TestReaddir.*' tests now passes.

R=golang-dev, lucio, r
CC=golang-dev
https://golang.org/cl/4381048
2011-04-12 16:58:56 -07:00
Rob Pike
4fe9f57413 fmt: allow %U for unsigned integers.
Suggested by jan.mercl@nic.cz.

R=rsc, jnml
CC=golang-dev
https://golang.org/cl/4376054
2011-04-12 11:03:05 -07:00
Brad Fitzpatrick
92210eefb2 http: client gzip support
R=adg, rsc, bradfitzwork
CC=golang-dev
https://golang.org/cl/4389048
2011-04-12 09:35:07 -07:00
Gustavo Niemeyer
c34aadf063 openpgp: Fix improper := shadowing
R=golang-dev, agl1, jnml
CC=golang-dev
https://golang.org/cl/4381058
2011-04-12 11:48:05 -03:00
Nigel Tao
ce89a233a2 image/ycbcr: new package.
R=r, rsc, nigeltao_gnome
CC=golang-dev, raph
https://golang.org/cl/4374043
2011-04-12 22:32:03 +10:00
Nigel Tao
420a17e371 net: fix laddr typo in test code.
R=rsc
CC=golang-dev
https://golang.org/cl/4381050
2011-04-12 10:36:41 +10:00
Robert Hencke
d36271a3e5 http: fix incorrect prints found by govet
R=golang-dev, bradfitzgo
CC=golang-dev
https://golang.org/cl/4370053
2011-04-11 13:05:08 -07:00
Fazlul Shahriar
8c1a703560 syscall: fix StartProcess in Plan 9
This makes os_test.TestStartProcess test from os package pass.

R=paulzhol, r2, r
CC=golang-dev
https://golang.org/cl/4385052
2011-04-11 12:39:53 -07:00
Mikkel Krautz
e2348deeec crypto/x509: expose complete DER data
R=agl1
CC=golang-dev
https://golang.org/cl/4376049
2011-04-11 11:20:12 -04:00
Luit van Drongelen
fe3dcfee27 asn1: Implement correct marshalling of length octets
Fixes #1683

R=agl1
CC=golang-dev, rsc
https://golang.org/cl/4367049
2011-04-11 10:28:34 -04:00
Dave Cheney
8b8b54ad5c net: disable multicast tests by default.
Fixes #1649.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/4343056
2011-04-11 10:39:21 +10:00
Dmitry Chestnykh
1b7142d157 archive/zip: add new type ReadCloser, make OpenReader return it.
Fixes #1678.

R=adg, rsc
CC=golang-dev
https://golang.org/cl/4372047
2011-04-10 11:23:23 +10:00
Robert Griesemer
ebaf01f052 go/printer, gofmt: use blank to separate import rename from import path
Note that declarations.golden is not using spaces for alignment (so
that the alignment tabs are visible) which is why this change affects
the test cases significantly. gofmt uses spaces for alignment (by default)
and only tabs for indentation.

gofmt -w src misc (no changes)

Fixes #1673.

R=iant
CC=golang-dev
https://golang.org/cl/4388044
2011-04-08 15:47:21 -07:00
Adam Langley
8fc6703391 big: don't crash when printing nil ints
"%#v" of a structure with *big.Int's tends to crash a lot otherwise.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4382044
2011-04-08 15:43:19 -04:00
Robert Hencke
8dc0ba7ae5 io: fixes for Read with n > 0, os.EOF
R=rsc
CC=golang-dev
https://golang.org/cl/4271080
2011-04-08 13:45:56 -04:00
Russ Cox
e6e2eb5807 http: do not listen on 0.0.0.0 during test
Quiets the pop-up boxes on OS X.

R=bradfitzgo, r2
CC=golang-dev
https://golang.org/cl/4387042
2011-04-08 13:04:29 -04:00
Russ Cox
db5c5d6fa6 update go tree for reflect changes
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4353043
2011-04-08 12:27:58 -04:00
Russ Cox
fb175cf77e reflect: new Type and Value definitions
Type is now an interface that implements all the possible type methods.
Instead of a type switch on a reflect.Type t, switch on t.Kind().
If a method is invoked on the wrong kind of type (for example,
calling t.Field(0) when t.Kind() != Struct), the call panics.

There is one method renaming: t.(*ChanType).Dir() is now t.ChanDir().

Value is now a struct value that implements all the possible value methods.
Instead of a type switch on a reflect.Value v, switch on v.Kind().
If a method is invoked on the wrong kind of value (for example,
calling t.Recv() when t.Kind() != Chan), the call panics.

Since Value is now a struct, not an interface, its zero value
cannot be compared to nil.  Instead of v != nil, use v.IsValid().
Instead of other uses of nil as a Value, use Value{}, the zero value.

Many methods have been renamed, most due to signature conflicts:

           OLD                          NEW

    v.(*ArrayValue).Elem             v.Index
    v.(*BoolValue).Get               v.Bool
    v.(*BoolValue).Set               v.SetBool
    v.(*ChanType).Dir                v.ChanDir
    v.(*ChanValue).Get               v.Pointer
    v.(*ComplexValue).Get            v.Complex
    v.(*ComplexValue).Overflow       v.OverflowComplex
    v.(*ComplexValue).Set            v.SetComplex
    v.(*FloatValue).Get              v.Float
    v.(*FloatValue).Overflow         v.OverflowFloat
    v.(*FloatValue).Set              v.SetFloat
    v.(*FuncValue).Get               v.Pointer
    v.(*InterfaceValue).Get          v.InterfaceData
    v.(*IntValue).Get                v.Int
    v.(*IntValue).Overflow           v.OverflowInt
    v.(*IntValue).Set                v.SetInt
    v.(*MapValue).Elem               v.MapIndex
    v.(*MapValue).Get                v.Pointer
    v.(*MapValue).Keys               v.MapKeys
    v.(*MapValue).SetElem            v.SetMapIndex
    v.(*PtrValue).Get                v.Pointer
    v.(*SliceValue).Elem             v.Index
    v.(*SliceValue).Get              v.Pointer
    v.(*StringValue).Get             v.String
    v.(*StringValue).Set             v.SetString
    v.(*UintValue).Get               v.Uint
    v.(*UintValue).Overflow          v.OverflowUint
    v.(*UintValue).Set               v.SetUint
    v.(*UnsafePointerValue).Get      v.Pointer
    v.(*UnsafePointerValue).Set      v.SetPointer

Part of the motivation for this change is to enable a more
efficient implementation of Value, one that does not allocate
memory during most operations.  To reduce the size of the CL,
this CL's implementation is a wrapper around the old API.
Later CLs will make the implementation more efficient without
changing the API.

Other CLs to be submitted at the same time as this one
add support for this change to gofix (4343047) and update
the Go source tree (4353043).

R=gri, iant, niemeyer, r, rog, gustavo, r2
CC=golang-dev
https://golang.org/cl/4281055
2011-04-08 12:26:51 -04:00
Robert Griesemer
0ada4a2d62 go/types: fix build: use the right compiler to compile test case
R=rsc
CC=golang-dev
https://golang.org/cl/4369050
2011-04-07 22:10:39 -07:00
Robert Griesemer
a87382e7b3 go/types: New Go type hierarchy implementation for AST.
This CL defines a new, more Go-like representation of
Go types (different structs for different types as
opposed to a single Type node). It also implements
an ast.Importer for object/archive files generated
by the gc compiler tool chain. Besides the individual
type structs, the main difference is the handling of
named types: In the old world, a named type had a
non-nil *Object pointer but otherwise looked no
different from other types. In this new model, named
types have their own representation types.Name. As
a result, resolving cycles is a bit simpler during
construction, at the cost of having to deal with
types.Name nodes explicitly later. It remains to be
seen if this is a good approach. Nevertheless, code
involving types reads more nicely and benefits from
full type checking. Also, the representation seems
to more closely match the spec wording.

Credits: The original version of the gc importer was
written by Evan Shaw (chickencha@gmail.com). The new
version in this CL is based largely on Evan's original
code but contains bug fixes, a few simplifications,
some restructuring, and was adjusted to use the
new type hierarchy. I have added a comprehensive test
that imports all packages found under $GOROOT/pkg (with
a 3s time-out to limit the run-time of the test). Run
gotest -v for details.

The original version of ExportData (exportdata.go) was
written by Russ Cox (rsc@golang.org). The current version
is returning the internal buffer positioned at the beginning
of the export data instead of printing the export data to
stdout.

With the new types package, the existing in-progress
typechecker package is deprecated. I will delete it
once all functionality has been brought over.

R=eds, rog, rsc
CC=golang-dev
https://golang.org/cl/4314054
2011-04-07 21:40:37 -07:00
Robert Griesemer
70bf4215e9 scanner: better TokenString output
R=rsc
CC=golang-dev
https://golang.org/cl/4373048
2011-04-07 19:41:55 -07:00
Alex Brainman
d3cd0c0752 syscall: fix Windows Signalled
Thanks to fhs.

R=golang-dev, r2
CC=ality, fhs, golang-dev
https://golang.org/cl/4375044
2011-04-08 10:27:47 +10:00
Russ Cox
62c24811e7 syscall: fix freebsd/386 again
TBR=r
CC=golang-dev
https://golang.org/cl/4380042
2011-04-07 15:44:10 -04:00
Russ Cox
62049366e7 syscall: freebsd/386 Syscall9 (fix build)
R=r
CC=golang-dev
https://golang.org/cl/4386042
2011-04-07 15:35:04 -04:00
Mikio Hara
c54ed66c75 syscall: fix build
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4368050
2011-04-07 12:03:45 -07:00