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

5488 Commits

Author SHA1 Message Date
Gustavo Niemeyer
133c6bf77f encoding/xml: move Unmarshal example to function
This also fixes MarshalIndent's example after the
recent formatting convention changes.

Fixes #2831.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5671062
2012-02-22 23:37:57 -02:00
Alex Brainman
fea7f07e56 time: run full TestTicker test even during short tests
R=golang-dev, r, bradfitz, r
CC=golang-dev
https://golang.org/cl/5689076
2012-02-23 12:07:59 +11:00
Mikio Hara
ee71afbb55 net: make raw IP tests robust
Make it rely on underlying socket's address family.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5673091
2012-02-23 06:27:05 +09:00
Mikio Hara
9765325d49 net: make parseProcNetIGMP more robust
Suggested by Paul Borman.

Fixes #2826.

R=rsc, borman
CC=golang-dev
https://golang.org/cl/5689048
2012-02-23 06:26:31 +09:00
Rob Pike
880cda557a os: make the system info a value not a pointer on unix
fix a couple of other minor related details.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5690071
2012-02-23 07:51:49 +11:00
Russ Cox
213997a730 net: delete debugging print
Fixes #3030.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5689071
2012-02-22 15:35:41 -05:00
Robert Griesemer
8b7cdb7f25 go/printer, gofmt: improved comma placement
Not a Go 1 issue, but appeared to be fairly easy to fix.

- Note that a few existing test cases look slightly worse but
  those cases were not representative for real code. All real
  code looks better now.

- Manual move of the comment in go/scanner/example_test.go
  before applying gofmt.

- gofmt -w $GOROOT/src $GOROOT/misc

Fixes #3062.

R=rsc
CC=golang-dev
https://golang.org/cl/5674093
2012-02-22 11:27:45 -08:00
Robert Griesemer
0c2f3b7ffd go/doc: move firstSentence into go/doc
- renamed firstSentence -> Synopsis
- also deal with common abbreviations

R=rsc
CC=golang-dev
https://golang.org/cl/5676088
2012-02-22 10:49:37 -08:00
Mikio Hara
215777b332 net: replace error variable name oserr with err
This CL replaces the last two in source tree.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5685080
2012-02-22 19:08:19 +09:00
Devon H. O'Dell
b0891060ae runtime: fix FreeBSD signal handling around thread creation
Ignore signals while we are spawning a new thread. Previously, a
signal arriving just before runtime.minit setting up the signal
handler triggers a "double fault" in signal trampolining.
Fixes #3017.

R=rsc, mikioh.mikioh, minux.ma, adg
CC=golang-dev
https://golang.org/cl/5684060
2012-02-22 15:44:09 +11:00
Russ Cox
5bcad92f07 ld: add NOPTRBSS for large, pointer-free uninitialized data
cc: add #pragma textflag to set it
runtime: mark mheap to go into noptr-bss.
        remove special case in garbage collector

Remove the ARM from.flag field created by CL 5687044.
The DUPOK flag was already in p->reg, so keep using that.

Otherwise test/nilptr.go creates a very large binary.
Should fix the arm build.
Diagnosed by minux.ma; replacement for CL 5690044.

R=golang-dev, minux.ma, r
CC=golang-dev
https://golang.org/cl/5686060
2012-02-21 22:08:42 -05:00
Devon H. O'Dell
8542dc0764 runtime: use SYSCALL instead of INT 0x80 in FreeBSD's runtime.osyield on amd64
R=mikioh.mikioh, rsc
CC=golang-dev
https://golang.org/cl/5690062
2012-02-22 11:04:25 +09:00
Brad Fitzpatrick
9c8923f7dc net/http: update test to use time.Duration better
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5688063
2012-02-22 11:22:09 +11:00
Brad Fitzpatrick
31e94293fc net/textproto: accept bad MIME headers as browsers do
Accept certain non-compliant response headers
(in particular, when spaces preceed the colon).
All major browser and curl seem to support this,
and at least one webserver seems to send these.

*shrug*

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5690059
2012-02-22 11:13:59 +11:00
Robert Griesemer
5f2ecbff71 text/tabwriter: fix documentation by adding an example.
R=rsc, r
CC=golang-dev
https://golang.org/cl/5685069
2012-02-21 14:48:17 -08:00
Russ Cox
2110fadd12 net/smtp: use EHLO then HELO
Before we were using "ESMTP" in the banner as a clue,
but that is not required by the RFC and breaks mailing
to smtp.yandex.ru.

Fixes #3045.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5687066
2012-02-21 16:39:02 -05:00
Russ Cox
fc7ed45b35 runtime: avoid malloc during malloc
A fault during malloc might lead to the program's
first call to findfunc, which would in turn call malloc.
Don't do that.

Fixes #1777.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5689047
2012-02-21 16:36:15 -05:00
Marcel van Lohuizen
ecd24f381e exp/norm: Added Iter type for iterating on segment boundaries. This type is mainly to be used
by other low-level libraries, like collate.  Extra care has been given to optimize the performance
of normalizing to NFD, as this is what will be used by the collator.  The overhead of checking
whether a string is normalized vs simply decomposing a string is neglible.  Assuming that most
strings are in the FCD form, this iterator can be used to decompose strings and normalize with
minimal overhead.

R=r
CC=golang-dev
https://golang.org/cl/5676057
2012-02-21 13:13:21 +01:00
Rob Pike
152d806b16 net: extend the workaround to DialTCP to try to get arm building again.
Awfulness by the bucket that we hope
Fixes #3057.

R=golang-dev, mikioh.mikioh, dsymonds, r, rsc
CC=golang-dev
https://golang.org/cl/5687060
2012-02-21 16:48:05 +11:00
Rob Pike
c9bb042287 net: more selfConnect debugging: panic if ra == nil in internetSocket
TBR=dsymonds

R=dsymonds
CC=golang-dev
https://golang.org/cl/5687058
2012-02-21 15:49:08 +11:00
Rob Pike
3970d2fd58 net: panic if sockaddrToTCP returns nil incorrectly
Part of diagnosing the selfConnect bug
TBR=dsymonds

R=golang-dev
CC=golang-dev
https://golang.org/cl/5687057
2012-02-21 15:21:34 +11:00
Rob Pike
2155a0408e net: add diagnostic to try to catch selfConnect bug earlier
TBR=dsymonds

R=golang-dev
CC=golang-dev
https://golang.org/cl/5683057
2012-02-21 14:53:07 +11:00
Rob Pike
ccacab641a os: replace non-portable Waitmsg with portable ProcessState
Use methods for key questions.
Provide access to non-portable pieces through portable methods.
Windows and Plan 9 updated.

R=golang-dev, bradfitz, bradfitz, r, dsymonds, rsc, iant, iant
CC=golang-dev
https://golang.org/cl/5673077
2012-02-21 14:10:34 +11:00
Mikio Hara
22c41ff019 runtime: remove an obsolete file
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5686049
2012-02-21 12:07:38 +09:00
Brad Fitzpatrick
8729d158ca net: more docs on deadlines
Fixes #2777

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5685060
2012-02-21 11:11:18 +11:00
Brad Fitzpatrick
dc19b94b21 net/http: add optional Server.TLSConfig field
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5688047
2012-02-21 10:24:15 +11:00
Devon H. O'Dell
dff5535aaa runtime: implement runtime.osyield on FreeBSD 386, amd64
R=rsc, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5689046
2012-02-21 07:32:20 +09:00
Mikio Hara
6e4ddc6872 net: move hosts testdata to testdata folder
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5687052
2012-02-21 07:11:44 +09:00
Rob Pike
b5a3bd5ff6 os: drop the Wait function and the options to Process.Wait
They are portability problems and the options are almost always zero in practice anyway.

R=golang-dev, dsymonds, r, bradfitz
CC=golang-dev
https://golang.org/cl/5688046
2012-02-20 15:36:08 +11:00
Brad Fitzpatrick
943f6cc837 database/sql/driver: API cleanups
-- add driver.Value type and documentation,
   convert from interface{} to Value where
   appropriate.
-- don't say "subset" anywhere,
-- SubsetValuer -> Valuer
-- SubsetValue -> Value
-- IsParameterSubsetType -> IsValue
-- IsScanSubsetType -> IsScanValue

Fixes #2842

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/5674084
2012-02-20 14:25:28 +11:00
Rob Pike
0ce6c87004 html/template: don't indirect past a Stringer
While we're here, get rid of the old names for the escaping functions.

Fixes #3073.

R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5685049
2012-02-20 14:23:45 +11:00
Russ Cox
a53317668a strconv: run garbage collection before counting allocations in test
My theory is that the call to f() allocates, which triggers
a garbage collection, which itself may do some allocation,
which is being counted.  Running a garbage collection
before starting the test should avoid this problem.

Fixes #2894 (I hope).

R=golang-dev, bradfitz, nigeltao
CC=golang-dev
https://golang.org/cl/5685046
2012-02-19 22:13:04 -05:00
Rob Pike
9c9b96f028 go/doc: update golden file to fix build
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5683046
2012-02-20 14:06:38 +11:00
Rob Pike
d6f8c751de all: rewrite references to old tool names
R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/5683045
2012-02-20 13:42:37 +11:00
Fazlul Shahriar
441538eb57 os,time: fix Plan 9 build
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5689043
2012-02-20 12:31:24 +11:00
David Symonds
bcb7a85334 html/template: minor tweak to docs to improve HTML typography.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5684046
2012-02-20 11:43:34 +11:00
Shenghou Ma
b17a233633 syscall: force Windows to always use US English error messages
Fixes #1834.

R=rsc, alex.brainman
CC=golang-dev
https://golang.org/cl/5673068
2012-02-20 09:51:25 +11:00
Russ Cox
1a0c8fe9bb cmd/cgo: bug fixes
* disallow embedding of C type (Fixes issue 2552)
* detect 0-length array (Fixes issue 2806)
* use typedefs when possible, to avoid attribute((unavailable)) (Fixes issue 2888)
* print Go types constructed from C types using original C types (Fixes issue 2612)

This fix changes _cgo_export.h to repeat the preamble from import "C".
Otherwise the fix to issue 2612 is impossible, since it cannot refer to
types that have not been defined.  If people are using //export and
putting non-header information in the preamble, they will need to
refactor their code.

R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/5672080
2012-02-19 13:32:55 -05:00
Russ Cox
8a4c2b3cc4 runtime: fix another memory leak
morebuf holds a pc/sp from the last stack split or
reflect.call or panic/recover.  If the pc is a closure,
the reference will keep it from being collected.

moreargp holds a pointer to the arguments from the
last stack split or reflect.call or panic/recover.
Normally it is a stack pointer and thus not of interest,
but in the case of reflect.call it is an allocated argument
list and holds up the arguments to the call.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5674109
2012-02-19 11:05:19 -05:00
Russ Cox
cb5e181fe7 time: switch to using (uncompressed) zoneinfo zip file
Removal of old zoneinfo files is a separate CL due to its size.

R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5676100
2012-02-19 03:16:20 -05:00
Russ Cox
990f9f4c00 encoding/json: disable anonymous fields
We should, after Go 1, make them work the same as
package xml, that is, make them appear in the outer
struct.  For now turn them off so that people do not
depend on the old behavior.

Fixing them is issue 3069.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5656102
2012-02-19 00:27:05 -05:00
Russ Cox
89b075cc90 runtime: fix tiny memory leak
The m->cret word holds the C return value when returning
across a stack split boundary.  It was not being cleared after
use, which means that the return value (if a C function)
or else the value of AX/R0 at the time of the last stack unsplit
was being kept alive longer than necessary.  Clear it.

I think the effect here should be very small, but worth fixing
anyway.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5677092
2012-02-19 00:26:33 -05:00
Brad Fitzpatrick
efacb2a1b4 os: remove Getenverror
Fixes #3065

R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5675094
2012-02-18 21:18:13 -08:00
Russ Cox
03f2289f7e runtime: API
Delete Alloc, Free, Lookup, Semacquire, Semrelease

Fixes #2955.

R=golang-dev, r, bradfitz
CC=golang-dev
https://golang.org/cl/5675093
2012-02-19 00:11:44 -05:00
Russ Cox
ad17a9c0a9 time: use Go distribution zoneinfo if system copy not found
Fixes #2964.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5656101
2012-02-18 21:02:41 -05:00
Mikio Hara
e91bf2e9d1 net: make LocalAddr on multicast return group address
Fixes #3067.

R=golang-dev, rsc, rsc
CC=golang-dev
https://golang.org/cl/5656098
2012-02-19 10:50:03 +09:00
Russ Cox
0e70f2722b all: shorten some of the longer tests
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5675092
2012-02-18 16:24:23 -05:00
Rob Pike
68b35b0852 templates: minor edits to the documentation
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5677084
2012-02-19 07:45:12 +11:00
Brad Fitzpatrick
a5f21c95dc os: document the type of link errors
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5673090
2012-02-18 04:45:43 -08:00
David Symonds
85f2d18a72 bytes: document Compare/Equal semantics for nil arguments, and add tests.
R=golang-dev, bradfitz, r, r
CC=golang-dev
https://golang.org/cl/5676090
2012-02-18 17:39:40 +11:00