1
0
mirror of https://github.com/golang/go synced 2024-10-02 20:31:21 -06:00
Commit Graph

5834 Commits

Author SHA1 Message Date
Russ Cox
1b79cd2e71 undo changes accidentally included in 09c5add99d50
R=ken2
CC=golang-dev
https://golang.org/cl/1736042
2010-06-20 12:45:39 -07:00
Russ Cox
45bdf0367e reflect: add Kind, remove Int8Type, Int8Value, etc.
update other code to match.

R=r
CC=golang-dev
https://golang.org/cl/1680044
2010-06-20 12:16:25 -07:00
Russ Cox
9f002f6892 gc: delete debug print
R=ken2
CC=golang-dev
https://golang.org/cl/1732043
2010-06-20 12:15:10 -07:00
Russ Cox
37c531f51f errchk: fix build - allow matches in multiline error messages
TBR=r
CC=golang-dev
https://golang.org/cl/1734042
2010-06-20 12:05:43 -07:00
Russ Cox
a212d174ac 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)

R=ken2
CC=golang-dev
https://golang.org/cl/1736041
2010-06-20 11:45:53 -07:00
Russ Cox
ceb868bf0a gc: fix build - subnode not addable in complexgen
R=ken2
CC=golang-dev
https://golang.org/cl/1677047
2010-06-20 11:21:43 -07:00
James Whitehead
d67717c29b 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.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/1723044
2010-06-20 11:46:12 +02:00
Russ Cox
a674c024c7 nacl: fix build
TBR=r
CC=golang-dev
https://golang.org/cl/1706044
2010-06-18 22:45:42 -07:00
Russ Cox
2d3e47ca10 strconv: add AtofN, FtoaN
R=r
CC=golang-dev
https://golang.org/cl/1700043
2010-06-18 22:43:37 -07:00
Christopher Wedgwood
34cc011276 test: add missing import for zerodivide
R=rsc
CC=golang-dev, r
https://golang.org/cl/1706043
2010-06-18 22:42:48 -07:00
Rob Pike
3748d22672 fmt.Scanf: improve error message when input does not match format
R=rsc
CC=golang-dev
https://golang.org/cl/1693043
2010-06-18 20:37:03 -07:00
Rob Pike
4fd7880d81 Effective Go: minor change to correct a comment in an example
R=rsc
CC=golang-dev
https://golang.org/cl/1689042
2010-06-18 20:33:03 -07:00
Russ Cox
21ff75bc0e complex divide: match C99 implementation
R=iant, ken2, r, r2, ken3
CC=golang-dev
https://golang.org/cl/1686044
2010-06-18 15:46:00 -07:00
Rob Pike
99b23a1e5b Effective Go: panic and recover
R=rsc, iant
CC=golang-dev
https://golang.org/cl/1718042
2010-06-18 10:52:37 -07:00
Rob Pike
050905b985 Effective Go: add a section on defer.
R=rsc, iant
CC=golang-dev
https://golang.org/cl/1694044
2010-06-16 13:47:36 -07:00
Brad Fitzpatrick
743f818218 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.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/1610042
2010-06-16 10:15:39 -07:00
Nigel Tao
93ea2ae362 cmd/gotest: Delete temporary _testmain.go files.
R=rsc
TBR=rsc
CC=golang-dev
https://golang.org/cl/1675047
2010-06-16 13:37:07 +10:00
Nigel Tao
6de79ee0ef image: add an Alpha16 type, for completeness.
R=rsc
CC=golang-dev, rog
https://golang.org/cl/1707042
2010-06-16 12:36:07 +10:00
Rob Pike
d60312c4c0 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.

Fixes #866.

R=rsc
CC=golang-dev
https://golang.org/cl/1712042
2010-06-15 17:41:11 -07:00
Rob Pike
9baa7a51ba bytes.Buffer.ReadFrom: fix bug.
Fixes #852.

R=rsc
CC=golang-dev
https://golang.org/cl/1680042
2010-06-15 17:40:47 -07:00
Rob Pike
6c08859b0e Effective Go: update ... discussion.
R=rsc
CC=golang-dev
https://golang.org/cl/1698041
2010-06-14 22:40:35 -07:00
Russ Cox
c9172fb2a3 runtime: correct fault for 16-bit divide on Leopard
R=r
CC=golang-dev
https://golang.org/cl/1703041
2010-06-14 18:07:17 -07:00
Rob Pike
177746ba31 fmt.Printf: write tests for %T.
Fix a bug that caused it to ignore field widths.

R=rsc
CC=golang-dev
https://golang.org/cl/1704041
2010-06-14 17:42:31 -07:00
Rob Pike
d482c163be 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)) }

R=rsc
CC=golang-dev
https://golang.org/cl/1613045
2010-06-14 17:16:35 -07:00
Nigel Tao
43b3a247d3 html: sync testdata/webkit to match WebKit tip.
R=rsc
CC=golang-dev
https://golang.org/cl/1701041
2010-06-15 09:07:47 +10:00
Rob Pike
dee4db0691 Add test for division by zero.
It fails with 6g. Once 6g is fixed up I will extend the value tests.

R=rsc, iant
CC=golang-dev
https://golang.org/cl/1677043
2010-06-14 15:00:19 -07:00
Roger Peppe
18274e0075 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.

R=r, r2
CC=golang-dev, hoisie, rsc
https://golang.org/cl/1198044
2010-06-14 14:54:48 -07:00
Rob Pike
b9055629c1 tutorial: update discussion of variadic functions
R=rsc
CC=golang-dev
https://golang.org/cl/1677042
2010-06-14 12:27:22 -07:00
Russ Cox
d5a80d0ba4 gc: no more ...
various cleanup, deleting unused code

R=ken2
CC=golang-dev
https://golang.org/cl/1663041
2010-06-14 11:24:51 -07:00
Russ Cox
6672b40c09 remove uses of ... from tree, add one test
R=r
CC=golang-dev
https://golang.org/cl/1662041
2010-06-14 11:23:11 -07:00
Nigel Tao
44a17e9df7 exp/draw: small draw.drawGlyphOver optimization.
Make dpix variable names consistent.

R=rsc
CC=golang-dev
https://golang.org/cl/1563041
2010-06-14 16:49:43 +10:00
Russ Cox
9562592342 spec: remove ... (keeping ...T)
R=gri, iant, ken2, r, r2
CC=golang-dev
https://golang.org/cl/1632041
2010-06-12 11:37:13 -07:00
Russ Cox
76da2780c3 gc: less aggressive name binding, for better line numbers in errors
Cleans up a few other corner cases too.

R=ken2
CC=golang-dev
https://golang.org/cl/1592045
2010-06-12 11:17:24 -07:00
Russ Cox
53a529ab2b runtime: fix 386 signal handler bug
Cannot assume that g == m->curg at time of signal.
Must save actual g and restore.

Fixes flaky crashes with messages like

throw: malloc mlookup
throw: malloc/free - deadlock
throw: unwindstack on self
throw: free mlookup

(and probably others) when running cgo.

R=iant
CC=golang-dev
https://golang.org/cl/1648043
2010-06-12 10:48:04 -07:00
Russ Cox
9d72aaabda gopack: add S flag to force marking a package as safe
R=r
CC=golang-dev
https://golang.org/cl/1597044
2010-06-12 10:47:42 -07:00
Rob Pike
db8c2b1803 spec: clarify that result parameters are always zeroed before the function executes.
R=golang-dev
CC=golang-dev
https://golang.org/cl/1641043
2010-06-11 21:30:03 -07:00
Russ Cox
089da369a3 8l: correct test for sp == top of stack in 8l -K code
R=ken2
CC=golang-dev
https://golang.org/cl/1627042
2010-06-11 16:17:47 -07:00
Russ Cox
ee0bca35a4 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.

R=r
CC=golang-dev
https://golang.org/cl/1647042
2010-06-11 15:29:19 -07:00
Russ Cox
d20ad1c75a gc: change -u to require imports to be marked safe
R=ken2
CC=golang-dev
https://golang.org/cl/1597043
2010-06-11 15:28:43 -07:00
Ian Lance Taylor
fe43325b30 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.

R=rsc
CC=golang-dev
https://golang.org/cl/1616042
2010-06-11 13:41:49 -07:00
Alex Brainman
c1e20720f7 runtime: switch to OS stack during Windows syscall
R=rsc
CC=golang-dev
https://golang.org/cl/1381041
2010-06-11 01:38:12 -07:00
Alex Brainman
fdb460ec11 runtime: free lock handles on Windows
R=rsc
CC=golang-dev
https://golang.org/cl/1652041
2010-06-11 00:53:54 -07:00
Russ Cox
6cd8537fd1 test: check that surrogate pair runes and huge rune values are rejected
R=r
CC=golang-dev
https://golang.org/cl/1615042
2010-06-10 13:30:39 -07:00
Paolo Giarrusso
9eb806f80b .hgignore: ignore doc/htmlgen
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/1555042
2010-06-09 21:39:40 -07:00
Paolo Giarrusso
3ca72458ec codereview: avoid exception in match
R=rsc
CC=golang-dev
https://golang.org/cl/1585041
2010-06-09 21:37:11 -07:00
Russ Cox
19783ef482 A+C: James Whitehead and Paolo Giarrusso (both individual CLA)
R=r
CC=golang-dev
https://golang.org/cl/1649041
2010-06-09 21:25:13 -07:00
Rob Pike
62b5c7c69d add path.Base, analogous to Unix basename
R=rsc
CC=golang-dev
https://golang.org/cl/1633042
2010-06-09 19:59:22 -07:00
Adam Langley
5f0319c0a6 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.

Fixes #850.

R=rsc
CC=golang-dev
https://golang.org/cl/1615043
2010-06-09 20:52:41 -04:00
Robert Griesemer
fb279e7347 bug286: test case
R=r
CC=golang-dev
https://golang.org/cl/1644042
2010-06-09 16:05:00 -07:00
Robert Griesemer
e0e5c150b0 exp/eval test: fix build
R=r
CC=golang-dev
https://golang.org/cl/1599043
2010-06-09 15:52:42 -07:00