]> Cypherpunks repositories - gostls13.git/log
gostls13.git
14 years agoruntime: fix arm build
Dave Cheney [Mon, 25 Apr 2011 22:33:57 +0000 (15:33 -0700)]
runtime: fix arm build

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

14 years agogc: explain why invalid receiver types are invalid
Russ Cox [Mon, 25 Apr 2011 21:16:44 +0000 (17:16 -0400)]
gc: explain why invalid receiver types are invalid

Fixes #1680.

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

14 years agoruntime: turn "too many EPIPE" into real SIGPIPE
Russ Cox [Mon, 25 Apr 2011 20:58:00 +0000 (16:58 -0400)]
runtime: turn "too many EPIPE" into real SIGPIPE

Tested on Linux and OS X, amd64 and 386.

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

14 years agotime: Support Irix 6 location for zoneinfo files.
Ian Lance Taylor [Mon, 25 Apr 2011 19:37:00 +0000 (12:37 -0700)]
time: Support Irix 6 location for zoneinfo files.

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

14 years agold: fix 6l -d on Mac, diagnose invalid use of -d
Russ Cox [Mon, 25 Apr 2011 17:57:52 +0000 (13:57 -0400)]
ld: fix 6l -d on Mac, diagnose invalid use of -d

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

14 years agofix tree for reflect rename
Russ Cox [Mon, 25 Apr 2011 17:39:36 +0000 (13:39 -0400)]
fix tree for reflect rename

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

14 years agoreflect: rename Typeof, NewValue -> TypeOf, ValueOf
Russ Cox [Mon, 25 Apr 2011 17:39:16 +0000 (13:39 -0400)]
reflect: rename Typeof, NewValue -> TypeOf, ValueOf

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

14 years agogofix: add support for reflect rename
Russ Cox [Mon, 25 Apr 2011 17:39:00 +0000 (13:39 -0400)]
gofix: add support for reflect rename

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

14 years ago8g,8l: fix "set but not used" gcc error
Fazlul Shahriar [Mon, 25 Apr 2011 16:14:30 +0000 (12:14 -0400)]
8g,8l: fix "set but not used" gcc error

$ gcc --version
gcc (GCC) 4.6.0 20110415 (prerelease)

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

14 years agoruntime: correct out of memory error
Russ Cox [Mon, 25 Apr 2011 16:13:54 +0000 (12:13 -0400)]
runtime: correct out of memory error

Fixes #1511.

R=golang-dev, iant2
CC=golang-dev
https://golang.org/cl/4433065

14 years agocodereview: various fixes
Russ Cox [Mon, 25 Apr 2011 16:12:53 +0000 (12:12 -0400)]
codereview: various fixes

Set mailed bit correctly for self-clpatch.
Use repo.rollback correctly.
Allow leading spaces in some C code.

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

14 years agogc: fix import width bug
Russ Cox [Mon, 25 Apr 2011 16:08:48 +0000 (12:08 -0400)]
gc: fix import width bug

Fixes #1705.

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

14 years agogc: allow complex types to be receiver types
Robert Hencke [Mon, 25 Apr 2011 16:02:54 +0000 (12:02 -0400)]
gc: allow complex types to be receiver types

Fixes #1716.

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

14 years agocrypto/tls: use time(), not Time().
Adam Langley [Mon, 25 Apr 2011 14:27:36 +0000 (10:27 -0400)]
crypto/tls: use time(), not Time().

The unexported version returns a sensible default when the user hasn't
set a value. The exported version crashes in that case.

R=bradfitzgo, rsc1
CC=golang-dev
https://golang.org/cl/4435070

14 years agojpeg: decode to a YCbCr image instead of an RGBA image.
Nigel Tao [Sun, 24 Apr 2011 09:25:49 +0000 (19:25 +1000)]
jpeg: decode to a YCbCr image instead of an RGBA image.

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

14 years agorc/env.bash: fix for Go tool-chain build on windows under msys.
Joe Poirier [Sat, 23 Apr 2011 18:34:08 +0000 (11:34 -0700)]
rc/env.bash: fix for Go tool-chain build on windows under msys.

The path conversion is done automatically if msys' builtin
shell commands are used.

R=rsc1, peterGo, brainman, Mr_Dark, r
CC=golang-dev
https://golang.org/cl/4452042

14 years agofmt: tweak the doc for %U.
Rob Pike [Sat, 23 Apr 2011 18:25:27 +0000 (11:25 -0700)]
fmt: tweak the doc for %U.
Fixes #1727.

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

14 years agogc: fix conversion of user-defined string type to []byte
Russ Cox [Sat, 23 Apr 2011 14:55:32 +0000 (10:55 -0400)]
gc: fix conversion of user-defined string type to []byte

Fixes #1709.

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

14 years agogc: fix return variable named _
Russ Cox [Sat, 23 Apr 2011 14:54:19 +0000 (10:54 -0400)]
gc: fix return variable named _

Fixes #1712.

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

14 years agogc: fix line number at EOF
Russ Cox [Sat, 23 Apr 2011 14:54:05 +0000 (10:54 -0400)]
gc: fix line number at EOF

Fixes #1474.

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

14 years agold: fix Plan 9 symbol table
Anthony Martin [Sat, 23 Apr 2011 14:53:49 +0000 (10:53 -0400)]
ld: fix Plan 9 symbol table

Static symbols were not being marked as such.

I also made the 'z' symbols use the first byte of
the name instead of an explicit NUL so that if
the symbol table format is ever changed, the only
place that would need updating is addhist().

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

14 years agoruntime: disable long test (fix arm build)
Russ Cox [Sat, 23 Apr 2011 14:03:51 +0000 (10:03 -0400)]
runtime: disable long test (fix arm build)

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

14 years agofmt: decrease recursion depth
Ian Lance Taylor [Fri, 22 Apr 2011 23:59:21 +0000 (16:59 -0700)]
fmt: decrease recursion depth

This permits the test to run when using gccgo on system
without split-stack support.  See
http://gcc.gnu.org/ml/gcc-patches/2011-04/msg01420.html
http://gcc.gnu.org/PR48553

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

14 years agogo spec: for map types, mention indexing operations
Robert Griesemer [Fri, 22 Apr 2011 23:26:51 +0000 (16:26 -0700)]
go spec: for map types, mention indexing operations
         (like we do for arrays and slices).

Suggested by mathieu.lonjaret@gmail.com .

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

14 years agocontainer/heap: fix circular dependency in test
David Symonds [Fri, 22 Apr 2011 20:29:05 +0000 (16:29 -0400)]
container/heap: fix circular dependency in test

Having the test be in the container/heap package yields a cycle
  container/heap (for the test)
  -> testing
  -> time
  -> container/heap (for timerHeap)

Occasionally the linker would get mixed up, resulting in a test panic
in a very weird place.

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

14 years agohttp: in ServerConn and ClientConn, rename Close to Hijack, add Close
Petar Maymounkov [Fri, 22 Apr 2011 19:56:27 +0000 (15:56 -0400)]
http: in ServerConn and ClientConn, rename Close to Hijack, add Close

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

14 years agocrypto/rsa: add file that I forgot to add last time.
Adam Langley [Fri, 22 Apr 2011 19:46:49 +0000 (15:46 -0400)]
crypto/rsa: add file that I forgot to add last time.

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

14 years agocrypto/rsa: support > 3 primes.
Adam Langley [Fri, 22 Apr 2011 19:33:41 +0000 (15:33 -0400)]
crypto/rsa: support > 3 primes.

With full multi-prime support we can support version 1 PKCS#1 private
keys. This means exporting all the members of rsa.PrivateKey, thus
making the API a little messy. However there has already been another
request to export this so it seems to be something that's needed.

Over time, rsa.GenerateMultiPrimeKey will replace rsa.GenerateKey, but
I need to work on the prime balance first because we're no longer
generating primes which are a multiples of 8 bits.

Fixes #987.

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

14 years agoruntime: stop deadlock test properly (fix arm5 build)
Russ Cox [Fri, 22 Apr 2011 19:22:11 +0000 (15:22 -0400)]
runtime: stop deadlock test properly (fix arm5 build)

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

14 years agosyscall: fix Ftruncate under linux/arm5
Dave Cheney [Fri, 22 Apr 2011 18:44:18 +0000 (14:44 -0400)]
syscall: fix Ftruncate under linux/arm5

Fixes #1714.

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

14 years agohttp/cgi: pass some default environment variables
Brad Fitzpatrick [Fri, 22 Apr 2011 18:02:33 +0000 (11:02 -0700)]
http/cgi: pass some default environment variables

This isn't really part of RFC 3875 but matches
the behavior of Apache, et al.

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

14 years agoos/user: new package to look up users
Brad Fitzpatrick [Fri, 22 Apr 2011 16:30:30 +0000 (09:30 -0700)]
os/user: new package to look up users

Only for Unix presently. Other operating systems
are stubbed out, as well as arm (lacks cgo).

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

14 years agohttp: fix FileServer's default text content type
Brad Fitzpatrick [Fri, 22 Apr 2011 16:09:37 +0000 (09:09 -0700)]
http: fix FileServer's default text content type

Fixes #1729

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

14 years agohttp/cgi: copy some PATH environment variables to child
Ian Lance Taylor [Fri, 22 Apr 2011 15:53:52 +0000 (08:53 -0700)]
http/cgi: copy some PATH environment variables to child

R=bradfitz, bradfitzwork, iant2, bradfitzgo
CC=golang-dev
https://golang.org/cl/4444058

14 years agoos: Open with O_APPEND|O_CREATE to append to the end of file on Windows
Alex Brainman [Fri, 22 Apr 2011 05:31:25 +0000 (15:31 +1000)]
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

14 years agohttp: clarify docs on Request HTTP version
Brad Fitzpatrick [Fri, 22 Apr 2011 02:57:19 +0000 (19:57 -0700)]
http: clarify docs on Request HTTP version

Fixes #910

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

14 years agohttp: close underlying gzip Reader too
Brad Fitzpatrick [Thu, 21 Apr 2011 23:01:29 +0000 (16:01 -0700)]
http: close underlying gzip Reader too

Fixes #1724

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

14 years agoxml: Parser hook for non-UTF-8 charset converters
Brad Fitzpatrick [Thu, 21 Apr 2011 21:37:26 +0000 (14:37 -0700)]
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

14 years ago8l/prof.c: #if 0 is not accepted by the Plan 9 native toolchain.
Lucio De Re [Thu, 21 Apr 2011 21:03:58 +0000 (17:03 -0400)]
8l/prof.c: #if 0 is not accepted by the Plan 9 native toolchain.

The solution may be a bit of a sledgehammer, but it looks like
a temporary situation anyway.

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

14 years agocgo: avoid "incompatible pointer type" warning
Albert Strasheim [Thu, 21 Apr 2011 21:02:52 +0000 (17:02 -0400)]
cgo: avoid "incompatible pointer type" warning

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

14 years agosyscall: add BPF support for darwin/386, darwin/amd64
Mikio Hara [Thu, 21 Apr 2011 20:58:20 +0000 (16:58 -0400)]
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

14 years agomime/multipart: limit line length to prevent abuse
Brad Fitzpatrick [Thu, 21 Apr 2011 17:45:49 +0000 (10:45 -0700)]
mime/multipart: limit line length to prevent abuse

Fixes #1528

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

14 years agogc: fix copy([]int, string) error message
Quan Yong Zhai [Thu, 21 Apr 2011 16:09:29 +0000 (12:09 -0400)]
gc: fix copy([]int, string) error message

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

14 years agoruntime: fix GOMAXPROCS vs garbage collection bug
Dmitriy Vyukov [Thu, 21 Apr 2011 16:09:25 +0000 (12:09 -0400)]
runtime: fix GOMAXPROCS vs garbage collection bug

Fixes #1715.

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

14 years agoCONTRIBUTORS: add Dmitriy Vyukov (Google CLA)
Russ Cox [Thu, 21 Apr 2011 16:09:19 +0000 (12:09 -0400)]
CONTRIBUTORS: add Dmitriy Vyukov (Google CLA)

R=golang-dev, r2
CC=golang-dev
https://golang.org/cl/4432055

14 years agoruntime: skip functions with no lines when building src line table
Ian Lance Taylor [Thu, 21 Apr 2011 15:32:58 +0000 (08:32 -0700)]
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

14 years agosyscall: Madvise and Mprotect for Linux.
Albert Strasheim [Thu, 21 Apr 2011 14:23:11 +0000 (10:23 -0400)]
syscall: Madvise and Mprotect for Linux.

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

14 years agonet: try /etc/hosts before loading DNS config.
Dmitry Chestnykh [Thu, 21 Apr 2011 14:23:03 +0000 (10:23 -0400)]
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

14 years agonet: fix EAI_BADFLAGS error on freebsd
Mikio Hara [Thu, 21 Apr 2011 14:22:53 +0000 (10:22 -0400)]
net: fix EAI_BADFLAGS error on freebsd

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

14 years agosyscall : add a field to ProcAttr so that StartProcess can hide the executed applicat...
Vincent Vanackere [Thu, 21 Apr 2011 14:12:06 +0000 (00:12 +1000)]
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

14 years agoA+C: Vincent Vanackere (individual CLA)
Russ Cox [Thu, 21 Apr 2011 14:09:53 +0000 (10:09 -0400)]
A+C: Vincent Vanackere (individual CLA)

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

14 years agogc: another pointer to interface message
Russ Cox [Thu, 21 Apr 2011 12:20:29 +0000 (08:20 -0400)]
gc: another pointer to interface message

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

14 years agogc: correct handling of unexported method names in embedded interfaces
Russ Cox [Thu, 21 Apr 2011 12:14:50 +0000 (08:14 -0400)]
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

14 years agosyscall: correct Windows CreateProcess input parameters
Alex Brainman [Thu, 21 Apr 2011 00:36:27 +0000 (10:36 +1000)]
syscall: correct Windows CreateProcess input parameters

Fixes #1718.

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

14 years agorun.bash: remove redundant rebuilds
Russ Cox [Wed, 20 Apr 2011 22:19:22 +0000 (18:19 -0400)]
run.bash: remove redundant rebuilds

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

14 years agogob: have errorf always prefix the message with "gob: "
Rob Pike [Wed, 20 Apr 2011 21:22:52 +0000 (14:22 -0700)]
gob: have errorf always prefix the message with "gob: "
to regularize the errors.

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

14 years agonet: fix windows build
Russ Cox [Wed, 20 Apr 2011 21:11:25 +0000 (17:11 -0400)]
net: fix windows build

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

14 years agogob: use new Implements and AssignableTo methods in reflect
Rob Pike [Wed, 20 Apr 2011 21:07:13 +0000 (14:07 -0700)]
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

14 years agohttp: don't proxy loopback addresses
Brad Fitzpatrick [Wed, 20 Apr 2011 20:53:34 +0000 (13:53 -0700)]
http: don't proxy loopback addresses

Fixes #1589

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

14 years agold: remove MachoLoad limit
Russ Cox [Wed, 20 Apr 2011 20:25:00 +0000 (16:25 -0400)]
ld: remove MachoLoad limit

Fixes #1571.

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

14 years agoreflect: add Type.Implements, Type.AssignableTo, Value.CallSlice; make Set match Go
Russ Cox [Wed, 20 Apr 2011 20:24:45 +0000 (16:24 -0400)]
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

14 years agogc: fix error for +string
Russ Cox [Wed, 20 Apr 2011 20:12:47 +0000 (16:12 -0400)]
gc: fix error for +string

Fixes #1710.

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

14 years agonet: use C library resolver on FreeBSD, Linux, OS X / amd64, 386
Russ Cox [Wed, 20 Apr 2011 19:21:59 +0000 (15:21 -0400)]
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

14 years agoreflect: update CanAddr, CanSet documentation
Russ Cox [Wed, 20 Apr 2011 19:04:04 +0000 (15:04 -0400)]
reflect: update CanAddr, CanSet documentation

CanAddr was wrong, out of date; CanSet was incomplete.

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

14 years agogofix, gofmt: update documentation
Robert Griesemer [Wed, 20 Apr 2011 18:01:21 +0000 (11:01 -0700)]
gofix, gofmt: update documentation

gofmt: also fix a typo in gofmt.go

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

14 years agogofmt: add -diff
David Crawshaw [Wed, 20 Apr 2011 17:07:56 +0000 (10:07 -0700)]
gofmt: add -diff

Some code duplication with gofix.

R=rsc, gri, bradfitzgo, r2, adg, peterGo, r, brainman
CC=golang-dev
https://golang.org/cl/4430054

14 years agogoinstall: support building executable commands
Andrew Gerrand [Wed, 20 Apr 2011 02:02:29 +0000 (12:02 +1000)]
goinstall: support building executable commands

This CL gives goinstall the ability to build commands,
not just packages.

"goinstall foo.googlecode.com/hg/bar" will build the command named
"bar" and install it to GOBIN. "goinstall ." will use the name of the
local directory as the command name.

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

14 years agosrc/pkg: make package doc comments consistently start with "Package foo".
Nigel Tao [Tue, 19 Apr 2011 23:57:05 +0000 (09:57 +1000)]
src/pkg: make package doc comments consistently start with "Package foo".

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

14 years agogo spec: attempt at clarifying language for "append"
Robert Griesemer [Tue, 19 Apr 2011 21:38:49 +0000 (14:38 -0700)]
go spec: attempt at clarifying language for "append"

Specifically, fix a wrong comment.

Fixes #1717.

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

14 years agogob: fix trivial bug in map marshaling.
Rob Pike [Tue, 19 Apr 2011 17:41:12 +0000 (10:41 -0700)]
gob: fix trivial bug in map marshaling.
Forgot to send key/value types.

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

14 years agoCONTRIBUTORS: add David Crawshaw (Google CLA)
Russ Cox [Tue, 19 Apr 2011 15:15:10 +0000 (11:15 -0400)]
CONTRIBUTORS: add David Crawshaw (Google CLA)

R=golang-dev, bradfitzgo
CC=golang-dev
https://golang.org/cl/4425054

14 years agocrypto/openpgp: better handling of keyrings.
Adam Langley [Tue, 19 Apr 2011 15:00:35 +0000 (11:00 -0400)]
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

14 years agocrypto/x509: fix build
Adam Langley [Tue, 19 Apr 2011 14:11:37 +0000 (10:11 -0400)]
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

14 years agocrypto: move certificate verification into x509.
Adam Langley [Tue, 19 Apr 2011 13:57:58 +0000 (09:57 -0400)]
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

14 years agoimage/jpeg: add an encoder.
Nigel Tao [Tue, 19 Apr 2011 01:00:47 +0000 (11:00 +1000)]
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

14 years agoreflect: allow Slice of arrays
Russ Cox [Tue, 19 Apr 2011 00:00:42 +0000 (20:00 -0400)]
reflect: allow Slice of arrays

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

14 years ago5c: make alignment rules match 5g, just like 6c matches 6g
Russ Cox [Mon, 18 Apr 2011 22:50:31 +0000 (18:50 -0400)]
5c: make alignment rules match 5g, just like 6c matches 6g

I should have done this a year ago in:

        changeset:   5137:686b18098944
        user:        Russ Cox <rsc@golang.org>
        date:        Thu Mar 25 14:05:54 2010 -0700
        files:       src/cmd/8c/swt.c
        description:
        make alignment rules match 8g, just like 6c matches 6g.

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

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

14 years agohttp: fix IP confusion in TestServerTimeouts
Russ Cox [Mon, 18 Apr 2011 20:03:24 +0000 (16:03 -0400)]
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

14 years agochanges for more restricted reflect.SetValue
Russ Cox [Mon, 18 Apr 2011 18:36:22 +0000 (14:36 -0400)]
changes for more restricted reflect.SetValue

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

14 years agoreflect: more efficient; cannot Set result of NewValue anymore
Russ Cox [Mon, 18 Apr 2011 18:35:33 +0000 (14:35 -0400)]
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

14 years agomime: add a TODO, fix the format of an error
Brad Fitzpatrick [Mon, 18 Apr 2011 18:21:16 +0000 (11:21 -0700)]
mime: add a TODO, fix the format of an error

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

14 years agomime: RFC 2231 continuation / non-ASCII support
Brad Fitzpatrick [Mon, 18 Apr 2011 17:59:39 +0000 (10:59 -0700)]
mime: RFC 2231 continuation / non-ASCII support

Fixes #1119.

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

14 years agotutorial: modernize the definition and use of Open.
Rob Pike [Mon, 18 Apr 2011 17:51:40 +0000 (10:51 -0700)]
tutorial: modernize the definition and use of Open.

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

14 years agogc: fix complex move again
Russ Cox [Mon, 18 Apr 2011 17:22:31 +0000 (13:22 -0400)]
gc: fix complex move again

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

14 years agotest/bench: update timings; moving to new machine.
Rob Pike [Mon, 18 Apr 2011 16:50:20 +0000 (09:50 -0700)]
test/bench: update timings; moving to new machine.
Interesting comparisons between old and new machine,
and relationship between gccgo and gc.

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4430045

14 years agonet: fix dialgoogle_test.go
Quan Yong Zhai [Mon, 18 Apr 2011 15:19:47 +0000 (11:19 -0400)]
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

14 years agoCONTRIBUTORS: Raph Levien (Google CLA)
Nigel Tao [Mon, 18 Apr 2011 08:40:01 +0000 (18:40 +1000)]
CONTRIBUTORS: Raph Levien (Google CLA)

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

14 years agoruntime: fix arm5 softfloat
Russ Cox [Sun, 17 Apr 2011 18:16:26 +0000 (14:16 -0400)]
runtime: fix arm5 softfloat

R=dfc, ken2, rsc
CC=golang-dev
https://golang.org/cl/4446043

14 years agocodereview: add 'hg undo' command
Russ Cox [Sun, 17 Apr 2011 18:15:51 +0000 (14:15 -0400)]
codereview: add 'hg undo' command

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

14 years agowebsocket: fix socket leak in test
Dave Cheney [Sun, 17 Apr 2011 16:43:27 +0000 (09:43 -0700)]
websocket: fix socket leak in test

Possibly fixes issue 1694.

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

14 years agomisc/goplay: fix Tab and Shift+Enter in Firefox.
Dmitry Chestnykh [Sat, 16 Apr 2011 08:44:51 +0000 (18:44 +1000)]
misc/goplay: fix Tab and Shift+Enter in Firefox.

Fixes #1633.

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

14 years agomime: bunch more tests, few minor parsing fixes
Brad Fitzpatrick [Fri, 15 Apr 2011 23:33:52 +0000 (16:33 -0700)]
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

14 years agoundo 4439044
Russ Cox [Fri, 15 Apr 2011 23:17:16 +0000 (19:17 -0400)]
undo 4439044

cannot use regalloc with floating point on 386.
will redo some other way.

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

14 years agocompress/zlib: add FDICT flag in Reader/Writer
Ross Light [Fri, 15 Apr 2011 22:32:03 +0000 (15:32 -0700)]
compress/zlib: add FDICT flag in Reader/Writer

R=bradfitzgo, rsc, bradfitzwork
CC=golang-dev
https://golang.org/cl/4406046

14 years agogc: fix complex move bug
Russ Cox [Fri, 15 Apr 2011 20:16:33 +0000 (16:16 -0400)]
gc: fix complex move bug

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

14 years agogc: print of unsafe.Pointer
Russ Cox [Fri, 15 Apr 2011 20:16:20 +0000 (16:16 -0400)]
gc: print of unsafe.Pointer

Got lost when I introduced TUNSAFEPTR.

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

14 years ago5g: correct size of reg array.
Ian Lance Taylor [Fri, 15 Apr 2011 20:09:57 +0000 (13:09 -0700)]
5g: correct size of reg array.

Found by gcc 4.5.2 -Werror build reported on IRC by niemeyer.

R=ken2, rsc, r2
CC=golang-dev
https://golang.org/cl/4438042

14 years agohttp: handler timeout support
Brad Fitzpatrick [Fri, 15 Apr 2011 19:53:32 +0000 (12:53 -0700)]
http: handler timeout support

Fixes #213

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

14 years agogodoc: use "search" input type for search box.
Dmitry Chestnykh [Fri, 15 Apr 2011 17:48:45 +0000 (10:48 -0700)]
godoc: use "search" input type for search box.

Uses placeholder attribute instead of changing the value of search
field on browsers that support it.  On other browsers, the fake
placeholder text is restored when the empty box loses focus.

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

14 years ago6l: fix another "set and not used".
Rob Pike [Fri, 15 Apr 2011 15:31:32 +0000 (08:31 -0700)]
6l: fix another "set and not used".

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