Peter Mundy [Mon, 28 Jun 2010 23:11:02 +0000 (09:11 +1000)]
syscall: Add syscall_bsd.go to zsycall_freebsd_386.go
Revision: 5885c9d10f created syscall_bsd.go for code used
by Darwin and other *BSDs, which should have included
FreeBSD. mksyscall.sh to generate new zsyscall_freebsd_386.go.
Roger Peppe [Mon, 21 Jun 2010 18:01:20 +0000 (11:01 -0700)]
goinstall: process dependencies for package main
Currently to install a command, you have to manually
goinstall each of the remote packages that it depends on.
This patch lets goinstall P work where P is
contains files in package main.
It does not actually build the package, but
it installs all of its dependencies and prints a message
to that effect.
Based on the review of CL 1723044, I've changed the installation instructions
for the vim syntax files to suggest symlinking the files rather than copying
the files. Also the wording has changed to be more consistent.
Russ Cox [Sun, 20 Jun 2010 18:45:53 +0000 (11:45 -0700)]
gc: better error messages for interface failures, conversions
x.go:13: cannot use t (type T) as type Reader in assignment:
T does not implement Reader (Read method requires pointer receiver)
x.go:19: cannot use q (type Q) as type Reader in assignment:
Q does not implement Reader (missing Read method)
have read()
want Read()
x.go:22: cannot use z (type int) as type Reader in assignment:
int does not implement Reader (missing Read method)
x.go:24: too many arguments to conversion to complex: complex(1, 3)
James Whitehead [Sun, 20 Jun 2010 09:46:12 +0000 (11:46 +0200)]
misc/vim: reorganize plugin so it uses ftplugin and syntax
This sets up vim to work out of the box with go programs as long as syntax
highlighting is enabled. Both files must be copied to the vim runtime
directory in order for the file-type detection and syntax loading to work.
Brad Fitzpatrick [Wed, 16 Jun 2010 17:15:39 +0000 (10:15 -0700)]
http: reply to Expect 100-continue requests automatically
This CL replaces my earlier https://golang.org/cl/1640044/show
in which Continue handling was explicit. Instead, this CL makes
it automatic. Reading from Body() is an implicit acknowledgement
that the request headers were fine and the body is wanted. In that
case, the 100 Continue response is written automatically when the
request continues the "Expect: 100-continue" header.
Rob Pike [Wed, 16 Jun 2010 00:41:11 +0000 (17:41 -0700)]
fmt.Scan: fix %c in the case where the input does not implement ReadRune itself.
While we're at it, clean up and test the code to guarantee we see every byte when
the text is erroneous UTF-8.
Rob Pike [Tue, 15 Jun 2010 00:16:35 +0000 (17:16 -0700)]
fmt.Print*: reimplement to switch on type first.
This shortens, simplifies and regularizes the code significantly.
(Improvements to reflect could make another step.)
Passes all.bash.
One semantic change occurs: The String() method changes
behavior. It used to run only for string formats such as %s and %q.
Instead, it now runs whenever the item has the method and the
result is then processed by the format as a string. Besides the
regularization, this has three effects:
1) width is honored for String() items
2) %x works for String() items
3) implementations of String that merely recur will recur forever
Regarding point 3, example from the updated documentation:
type X int
func (x X) String() string { return Sprintf("%d", x) }
should cast the value before recurring:
func (x X) String() string { return Sprintf("%d", int(x)) }
Roger Peppe [Mon, 14 Jun 2010 21:54:48 +0000 (14:54 -0700)]
Add IndexFunc and LastIndexFunc.
Change TrimRight and TrimLeft to use these functions.
Incidentally fix minor bug in TrimRight.
Add some test cases for this.
YMMV whether it's worth saving the closure allocation.
Russ Cox [Fri, 11 Jun 2010 22:29:19 +0000 (15:29 -0700)]
gopack: simplify go metadata code
There's only one Go object file per package now,
so there's no need to parse the metadata and merge
metadata from multiple files. Just save the original
and use it as __.PKGDEF verbatim.
Ian Lance Taylor [Fri, 11 Jun 2010 20:41:49 +0000 (13:41 -0700)]
Pad Go symbol table out to page boundary when linking dynamically.
This avoids a crash when using cgo where glibc's malloc thinks
that it can use some of the memory following the symbol table.
This fails because the symbol table is mapped read-only, which
affects the whole page.
Adam Langley [Thu, 10 Jun 2010 00:52:41 +0000 (20:52 -0400)]
asn1: allow '*' in PrintableString.
Although technically incorrect, we want this in order to parse X.509
certificates where a wildcard hostname ("*.example.com") has been put
into a PrintableString.
Russ Cox [Wed, 9 Jun 2010 18:00:55 +0000 (11:00 -0700)]
gc: more cleanup
* disallow surrogate pair runes.
* diagnose impossible type assertions
* eliminate another static buffer.
* do not overflow lexbuf.
* add -u flag to disable package unsafe.
Russ Cox [Wed, 9 Jun 2010 01:50:02 +0000 (18:50 -0700)]
gc: new typechecking rules
* Code for assignment, conversions now mirrors spec.
* Changed some snprint -> smprint.
* Renamed runtime functions to separate
interface conversions from type assertions:
convT2I, assertI2T, etc.
* Correct checking of \U sequences.
Robert Griesemer [Wed, 9 Jun 2010 00:06:26 +0000 (17:06 -0700)]
go/parser: correct position of empty statement ';'
(caused certain files to not be idempotent under gofmt)
- corrected golden files for go/printer
- slightly simplified some code in nodes.go (no impact on formatting)
- these changes have no impact on gofmt output of .go files under src, misc