Russ Cox [Wed, 9 Feb 2011 19:38:33 +0000 (14:38 -0500)]
runtime: new allocation strategy for amd64
Do not reserve virtual address space.
Instead, assume it will be there when we need it,
and crash loudly if that assumption is violated.
Reserving the address space gets charged to
ulimit -v, which exceeds commonly set limits.
Roger Peppe [Wed, 9 Feb 2011 18:57:59 +0000 (10:57 -0800)]
rpc: make more tolerant of errors.
Add Error type to enable clients to distinguish
between local and remote errors.
Also return "connection shut down error" after
the first error return rather than returning the
same error each time.
Robert Griesemer [Wed, 9 Feb 2011 17:52:32 +0000 (09:52 -0800)]
go/printer: remove notion of "Styler", remove HTML mode
Neither gofmt nor godoc are making use of a Styler (for
token-specific formatting) anymore. Stylers interacted in complicated
ways with HTML-escaping which was why the printer needed an HTML mode
in the first place.
godoc now uses a more powerful and general text formatting
function that does HTML escaping, text selection, and can
handle token-specific formatting if so desired (currently
used only for comments).
As a consequence, cleaned up uses of go/printer in godoc;
simplified the various write utility functions, and also
removed the need for the "html" template format (in favor of
html-esc which now does the same and is used more pervasively).
Applied gofmt -w src misc to verify no changes occured,
and tested godoc manually.
There should be no visible changes except that (type) code
snippets presented for godoc package documentation now
uses the same formatting as for general source code and
thus comments get the comment-specific color here as well
(not the case at the moment).
Gustavo Niemeyer [Wed, 9 Feb 2011 04:50:23 +0000 (23:50 -0500)]
build: Drop syslog on DISABLE_NET_TESTS=1
Even if local, it requires communication with a daemon
which may not be available. This is creating problems
for getting an Ubuntu package going in Launchpad's PPA.
Gustavo Niemeyer [Wed, 9 Feb 2011 04:50:14 +0000 (23:50 -0500)]
cgo: fix handling of signed enumerations
Structs defined in C as containing a field with
an enum type are currently translated to Go as
a struct with an unsigned integer field, even if
some of the values contained in the enum are
negative.
This modification takes in consideration the values
defined in the enum, and conditionally defines the
Go type as signed if necessary.
The logic introduced was tested with gcc, which
will increase the type size if it contains both
negative numbers and values greater than 2^b/2-1,
and refuses to compile values which would be
problematic (2^64-1, but in fact the ISO C
restricts the range to the size of int).
Robert Griesemer [Tue, 8 Feb 2011 21:31:01 +0000 (13:31 -0800)]
go spec: clarification re: method sets of newly declared pointer types
- added an example to Type declarations section clarifying the
situation brought up with issue 1324
- slightly re-ordered paragraphs in Types section
- added separate heading for method set section and refer to it
from elsewhere in the spec
- no language changes
Graham Miller [Tue, 8 Feb 2011 20:42:31 +0000 (12:42 -0800)]
netchan: graceful handling of closed connection
Currently, when an importer closes the connection, the exporter gives an
error message 'netchan export: error decoding client header:EOF'. This
change causes the exporter to look for an EOF during the parse of the
header, and silences the log message in that case.
Adam Langley [Sat, 5 Feb 2011 18:54:25 +0000 (13:54 -0500)]
crypto/tls: load a chain of certificates from a file.
Many recently issued certificates are chained: there's one or more
intermediate certificates between the host certificate and the root CA
certificate. This change causes the code to load any number of
certificates from the certificate file. This matches the behaviour of
common webservers, and the output of OpenSSL's command line tools.
Robert Griesemer [Sat, 5 Feb 2011 01:34:16 +0000 (17:34 -0800)]
go/printer, gofmt: smarter handling of multi-line raw strings
If a multi-line raw string is the first token on a line, it
should not be indented because the following lines (belonging
to the raw string) are not indented either.
Adjusted src of ebnf/ebnf_test.go manually as it now is formatted
as expected.
Rob Pike [Fri, 4 Feb 2011 21:14:38 +0000 (13:14 -0800)]
scan: permit base prefixes 0nnn and 0xnn when scanning
signed or unsigned integers using %v or the formatless scanner.
That is, Sscan("0x11", &i) or Sscanf("0x11", "%v", &i) will now
set i to 17. If a format other than %v is presented, the behavior
is as before.
Gustavo Niemeyer [Thu, 3 Feb 2011 20:39:11 +0000 (12:39 -0800)]
sync: Proposal for barrier implementation
As discussed in the mailing list, this adds a simple barrier
implementation to the sync package which enables one or more
goroutines to wait for a counter to go down to zero.
R=rsc, rog, r
CC=golang-dev
https://golang.org/cl/3770045
Dave Cheney [Thu, 3 Feb 2011 19:15:35 +0000 (14:15 -0500)]
syscall: add SetsockoptIpMreq
notes:
* due to Issue 1466 the Msghdr struct for
src/pkg/syscall/ztypes_darwin_386.go
src/pkg/syscall/ztypes_darwin_amd64.go
had to be edited after the godefs generation.
* ztypes_*.go files for linux, freebsd and darwin
have been prepared on the correct host OS and ARCH.
While the total increase is a dozen lines per file
the diff is larger due to a change to godefs,
http://code.google.com/p/go/source/detail?r=c79e30afe9c8
while has altered the names of Pad members which
causes gofmt to realign the affected structs
Robert Griesemer [Thu, 3 Feb 2011 18:53:31 +0000 (10:53 -0800)]
go spec: adjust notion of Assignability
This change makes it legal to pass a struct value as receiver
outside the package declaring the struct even if the respective
struct type has non-exported fields.
This is a backwards-compatible language change motivated by the
fact that it is already possible to circumvent the assignment
restriction when calling methods through interfaces (see issue
1402).
Russ Cox [Thu, 3 Feb 2011 18:51:43 +0000 (13:51 -0500)]
gc, ld: detect stale or incompatible object files
The object files begin with a header that is
$GOARCH
on a line by itself. This CL changes that header to
go object $GOOS $GOARCH release.2011-01-01 4567+
where the final two fields are the most recent release
tag and the current hg version number.
All objects imported into a Go compilation or linked into an
executable must have the same header line, and that header
line must match the compiler and linker versions.
The effect of this will be that if you update and run all.bash
and then try to link in objects compiled with an earlier version
of the compiler (or invoke the wrong version of the compiler),
you will get an error showing the different headers instead
of perhaps silent incompatibility.
Normal usage with all.bash should be unaffected, because
all.bash deletes all the object files in $GOROOT/pkg/$GOOS_$GOARCH
and cleans all intermediate object files before starting.
This change is intended to diagnose stale objects arising when
users maintaining alternate installation directories forget to
rebuild some of their files after updating.
It should help make the adoption of $GOPATH (CL 3780043)
less error-prone.
R=ken2, r
CC=golang-dev
https://golang.org/cl/4023063
Russ Cox [Thu, 3 Feb 2011 18:40:51 +0000 (13:40 -0500)]
spec: allow imported packages named main
Prior to this CL, there were two requirements about the
package name main.
1. The package that sits at the root of the import graph
(the one where program execution begins)
must be named main.
2. No other package in the program can be named main.
This CL only removes requirement #2, which can be done
without changing any other Go documentation.
The new wording and formatting is such that removing
requirement #1 can be done by deleting a single line,
but making that change is explicitly outside the scope
of this CL, because it would require changes to other
documentation at the same time.
Adam Langley [Thu, 3 Feb 2011 14:22:40 +0000 (09:22 -0500)]
crypto/openpgp/packet: add basic routines
Since nobody suggested major changes to the higher level API, I'm
splitting up the lower level code for review. This is the first of the
changes for the packet reading/writing code.
It deliberately doesn't include a Makefile because the package is
incomplete.
Adam Langley [Thu, 3 Feb 2011 14:19:20 +0000 (09:19 -0500)]
crypto/openpgp/armor: bug fixes
* Don't require lines to be full.
* Don't forget to flush the line buffer.
* Update the test so that it doesn't happen to include only full lines
in order to test the above.
* Always write the line after the header as GNUPG expects it.
Adam Langley [Thu, 3 Feb 2011 14:17:42 +0000 (09:17 -0500)]
crypto/cipher: add resync open to OCFB mode.
OpenPGP changed its OCFB mode for more modern packets (for example, the
MDC symmetrically encrypted packet). This change adds a bool to
determine which mode is used.
Gustavo Niemeyer [Thu, 3 Feb 2011 03:37:40 +0000 (22:37 -0500)]
cgo: fix _cgo_run timestamp file order
The timestamp file is being created before cgo
runs, which means errors will not prevent it
from being created and thus will cause the
build to break by rendering the rule up-to-date
when it isn't.