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

3408 Commits

Author SHA1 Message Date
Russ Cox
21e75da486 respect goto restrictions
R=gri
CC=golang-dev
https://golang.org/cl/4625044
2011-06-17 06:07:13 -04:00
Alex Brainman
8155ff5452 go/build: use back quotes for regular expression
R=adg
CC=golang-dev
https://golang.org/cl/4643045
2011-06-17 16:41:59 +10:00
Andrew Gerrand
4340b57d88 goinstall, go/build: support building cgo packages
Fixes #1962.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4636044
2011-06-17 11:15:54 +10:00
Nigel Tao
278952c393 regexp: add a package prefix to error strings.
R=r, r
CC=golang-dev
https://golang.org/cl/4630041
2011-06-17 10:50:38 +10:00
Brad Fitzpatrick
380e5a3709 http: document http client/transport thread safety
Fixes #1961

R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/4633045
2011-06-16 15:02:47 -07:00
Russ Cox
fc77e82617 unicode: add case folding tables
R=r, r
CC=golang-dev
https://golang.org/cl/4571074
2011-06-16 17:56:25 -04:00
Brad Fitzpatrick
6e9b1a78ff http: make Headers be source of truth
Previously Request and Response had redundant fields for
Referer, UserAgent, and cookies which caused confusion and
bugs.  It also didn't allow us to expand the package over
time, since the way to access fields would be in the Headers
one day and promoted to a field the next day.  That would be
hard to gofix, especially with code ranging over Headers.

After a discussion on the mail package's design with a similar
problem, we've designed to make the Headers be the source of
truth and add accessors instead.

Request:
change: Referer -> Referer()
change: UserAgent -> UserAgent()
change: Cookie -> Cookies()
new: Cookie(name) *Cookie
new: AddCookie(*Cookie)

Response:
change: Cookie -> Cookies()

Cookie:
new: String() string

R=rsc
CC=golang-dev
https://golang.org/cl/4620049
2011-06-16 13:02:28 -07:00
Volker Dobler
7f3e109d2f xml: allow attributes without value in non-strict mode.
Attributes without value are commen in html and the xml
parser will accept them in non-strict mode and use the
attribute name as value. Thus parsing <p nowrap> as
<p norwar="nowrap">.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4601053
2011-06-16 12:56:49 -04:00
Brad Fitzpatrick
98f95b8048 mime/multipart: convert Reader from interface to struct
It was always a weird interface but I didn't know what I
was doing at the time.  rsc questioned me about it then
but didn't press on it during review.  Then adg bugged me
about it too recently.

So clean it up. It parallels the Writer struct too.

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/4602063
2011-06-16 08:55:53 -07:00
Russ Cox
95963e6294 runtime/cgo: fix for OS X 10.7
Correct a few error messages (libcgo -> runtime/cgo)
and delete old nacl_386.c file too.

Fixes #1657.

R=iant
CC=golang-dev
https://golang.org/cl/4603057
2011-06-16 11:10:31 -04:00
Rob Pike
2b08e952bb sort: change the name of Float64Array to Float64Slice.
I missed this before because I used the wrong regexp. What a moron.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4639041
2011-06-16 17:48:02 +10:00
Robert Griesemer
333167ff35 go/printer, gofmt: print "select {}" on one line
No impact on existing sources under src, misc.

Fixes #1959.

R=r, rsc, r
CC=golang-dev
https://golang.org/cl/4589056
2011-06-15 21:47:29 -07:00
Russ Cox
f011bd378f build: use awk instead of giant egrep regexp
Avoids buggy version of egrep on some Macs.

R=r, dsymonds
CC=golang-dev
https://golang.org/cl/4603056
2011-06-16 00:04:24 -04:00
Dave Cheney
832e87500e go/build: support building cgo packages on non intel platforms
See https://golang.org/cl/4572045/

R=adg, rsc
CC=golang-dev
https://golang.org/cl/4627041
2011-06-16 13:35:27 +10:00
Nigel Tao
9555ea7a5b image/draw: add an Op argument to Draw.
R=r
CC=golang-dev
https://golang.org/cl/4622041
2011-06-16 11:45:16 +10:00
Yasuhiro Matsumoto
7fd51f2fb4 syscall: use strict in perl scripts
R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/4609047
2011-06-15 17:41:07 -07:00
Russ Cox
0193139bec undo CL 4557047 / 8818ac606e92
I don't think we've discussed this API enough.

««« original CL description
bike/shed: new package.

It comes up often enough that it's time to provide
the utility of a standard package.

R=r, mirtchovski, adg, rsc, n13m3y3r, ality, go.peter.90, lstoakes, iant, jan.mercl, bsiegert, robert.hencke, rogpeppe, befelemepeseveze, kevlar
CC=golang-dev
https://golang.org/cl/4557047
»»»

R=dsymonds, bradfitz, gri
CC=golang-dev
https://golang.org/cl/4576065
2011-06-15 19:47:52 -04:00
Rob Pike
d6653fed98 http: use runtime/debug.Stack() to dump stack trace on panic.
Test output now looks like this:

2011/06/15 21:10:41 http: panic serving 127.0.0.1:59729: intentional death for testing
$GOROOT/src/pkg/http/server.go:495 (0x3f9f8)
        _func_004: buf.Write(debug.Stack())
$GOROOT/src/pkg/runtime/proc.c:1041 (0x12367)
        panic: reflect·call(d->fn, d->args, d->siz);
$GOROOT/src/pkg/http/serve_test.go:775 (0x5831b)
        _func_029: panic("intentional death for testing")
$GOROOT/src/pkg/http/server.go:575 (0x26366)
        HandlerFunc.ServeHTTP: f(w, r)
$GOROOT/src/pkg/http/server.go:541 (0x261a9)
        *conn.serve: c.handler.ServeHTTP(w, w.req)
$GOROOT/src/pkg/runtime/proc.c:178 (0x10a83)
        goexit: runtime·goexit(void)

with $GOROOT expanded, of course.

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/4607051
2011-06-16 00:12:50 +10:00
Andrew Gerrand
39208939c6 go/build: better, self-contained tests
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4576063
2011-06-15 21:35:34 +10:00
Dave Cheney
c357ca663f go/build: remove crud in cgotest/_obj
R=adg
CC=golang-dev
https://golang.org/cl/4584060
2011-06-15 16:39:17 +10:00
Andrew Gerrand
7c248ae077 go/build: fix build and clean ups
R=rsc
CC=golang-dev
https://golang.org/cl/4620045
2011-06-15 14:56:12 +10:00
Andrew Gerrand
4a8de67058 go/build: record all cgo intermediate files (fix build)
R=rsc
CC=golang-dev
https://golang.org/cl/4613045
2011-06-15 14:29:26 +10:00
Andrew Gerrand
db5a4ffc2a goinstall: use go/make package to scan and build packages
R=rsc, n13m3y3r, kevlar
CC=golang-dev
https://golang.org/cl/4515180
2011-06-15 13:28:35 +10:00
Yasuhiro Matsumoto
414da2e4a3 syscall: mksyscall_windows.pl should output unix newline.
R=golang-dev, bradfitz, alex.brainman
CC=golang-dev
https://golang.org/cl/4601058
2011-06-15 11:50:21 +10:00
David Symonds
812b2b6405 mail: cosmetic fixes.
R=rsc, gri
CC=golang-dev
https://golang.org/cl/4602062
2011-06-15 09:10:59 +10:00
Russ Cox
1a4681ed74 exp/regexp/syntax: more escapes, character classes
Still TODO: parsing optimizations

make_perl_groups.pl is copied with minimal modifications
(just to generate Go syntax instead of C++) from RE2.
Google Inc is "The RE2 Author" of that file and is one of
the Go Authors, so copyright changed to the Go Authors instead.

R=sam.thorogood, r, fvbommel, robert.hencke
CC=golang-dev
https://golang.org/cl/4612041
2011-06-14 14:30:10 -04:00
Gustavo Niemeyer
a5c1fa7f02 debug/elf: rename test .o files to .obj
.o files are commonly found in default ignore lists by
source management tools, including dpkg-source, bzr, etc.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4568078
2011-06-14 15:06:39 -03:00
Mikio Hara
c4dfc55be9 net: export all fields in Interface
Fixes #1942.

R=fullung, rsc
CC=golang-dev
https://golang.org/cl/4602044
2011-06-14 13:32:52 -04:00
Jeff Hodges
0ce57a73c5 syscall: add ptrace on darwin
The ptrace syscall remains gutted on darwin, but usable.  This
also makes the syscall addition process reproducible on darwin
instead of relying on a file path in rsc's home directory.
I've also removed an override of $PATH in env.bash that made
tooling harder.

R=rsc, dave, r
CC=golang-dev
https://golang.org/cl/4517147
2011-06-14 12:56:46 -04:00
Maxim Ushakov
5f77bf8b20 xml: handle non-string attribute fields
R=kevlar, rsc
CC=golang-dev
https://golang.org/cl/4528114
2011-06-14 11:51:03 -04:00
Alex Brainman
c195cc8d82 exec: make LookPath work even when PATHEXT env variable is not set on Windows
R=golang-dev, mattn.jp
CC=golang-dev
https://golang.org/cl/4559062
2011-06-14 11:46:05 -04:00
William Chan
5af8e53a14 http/spdy: improve error handling.
Create a new spdy.Error type that includes the enumerated error type and
the associated stream id (0 if not associated with a specific stream).
This will let users handle errors differently (RST_STREAM vs GOAWAY).

R=bradfitz, rsc, rogpeppe
CC=golang-dev
https://golang.org/cl/4532131
2011-06-14 11:31:18 -04:00
Yuval Pavel Zholkover
400d825ea0 syscall: fix Plan 9 build.
Move mmapper from syscall.go to syscall_unix.go.
Remove Sendfile from syscall_plan9.go.

R=rsc, alex.brainman
CC=golang-dev
https://golang.org/cl/4368060
2011-06-14 11:29:51 -04:00
Mikio Hara
b100a29bc4 syscall: update BPF support for BSD variants
R=dave, rsc
CC=golang-dev
https://golang.org/cl/4589044
2011-06-14 11:28:36 -04:00
Yuval Pavel Zholkover
18112437d9 os: Plan 9, fix OpenFile & Chmod. Update tests.
Add Process.Kill.

R=rsc
CC=golang-dev
https://golang.org/cl/4571049
2011-06-14 11:20:34 -04:00
Russ Cox
4d0f2e9195 syscall, os, exec: introduce *syscall.SysProcAttr field in os.ProcAttr and exec.Cmd
R=r, bradfitz, alex.brainman, borman, vincent.vanackere
CC=golang-dev
https://golang.org/cl/4607046
2011-06-14 10:49:34 -04:00
David Symonds
371aa14e06 mail: decode RFC 2047 "B" encoding.
R=rsc, r
CC=golang-dev
https://golang.org/cl/4584056
2011-06-14 17:32:47 +10:00
Rob Pike
34e0725dec os: be explicit in the package comment that this package is for portable features only.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4602058
2011-06-14 11:49:33 +10:00
Russ Cox
9968090ddd cgo: handle new Apple LLVM-based gcc from Xcode 4.2
That gcc does not include enumerator names and values
in its DWARF debug output.  Create a data block from which
we can read the values instead.

Fixes #1881.

R=iant
CC=golang-dev
https://golang.org/cl/4607045
2011-06-13 14:43:54 -04:00
Adam Langley
8834bb0bfa crypto/openpgp: flesh out Encrypt by adding support for signing.
R=bradfitz
CC=golang-dev
https://golang.org/cl/4572059
2011-06-13 13:04:59 -04:00
Russ Cox
b96c3477f8 exp/regexp/syntax: syntax data structures, parser
Parser is a work in progress but can populate most of the
interesting parts of the data structure, so a good checkpoint.
All the complicated Perl syntax is missing, as are various
important optimizations made during parsing to the
syntax tree.

The plan is that exp/regexp's API will mimic regexp,
and exp/regexp/syntax provides the parser directly
for programs that need it (and for implementing exp/regexp).

Once finished, exp/regexp will replace regexp.

R=r, sam.thorogood, kevlar, edsrzf
CC=golang-dev
https://golang.org/cl/4538123
2011-06-13 09:20:23 -04:00
Rob Pike
7bc8e90e36 exp/template: lexical scanner for new template package.
An unusual design using slice and a goroutine makes for a
compact scanner with very little allocation.

R=rsc, r
CC=golang-dev, kevlar
https://golang.org/cl/4610041
2011-06-13 16:08:35 +10:00
Alex Brainman
9ded954a3b net: rearrange source files so we could run more tests on windows
R=rsc
CC=golang-dev
https://golang.org/cl/4603043
2011-06-13 10:22:31 +10:00
Alex Brainman
27cbf06d50 mime/multipart: allow for temp files to be removed after tests are finished on Windows
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4605044
2011-06-11 16:23:44 +10:00
Yasuhiro Matsumoto
1374097381 net: Sendfile for win32.
implement using TransmitFile().

R=bsiegert, bradfitz, alex.brainman, rsc, go.peter.90
CC=golang-dev
https://golang.org/cl/4536076
2011-06-11 13:24:48 +10:00
Robert Griesemer
968afa0e8c go/scanner: partially revert CL4538096 now that we have %#U for runes
R=r, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/4572049
2011-06-10 17:19:01 -07:00
Robert Griesemer
c8ee1b8ebc io/ioutil: fix typo in comment
R=r, r
CC=golang-dev
https://golang.org/cl/4592052
2011-06-10 17:07:22 -07:00
Rob Pike
d152fe74e1 fmt: debugging formats for characters: %+q %#U
%+q uses strconv.Quote[Rune]ToASCII, guaranteeing ASCII-only output.
%#U a quoted character if the rune is printable: 'x'=U+0078; otherwise
it's as before: U+000A.

R=golang-dev, gri, rsc
CC=golang-dev
https://golang.org/cl/4589047
2011-06-11 00:03:02 +00:00
Rob Pike
4b1170d2b1 sort: change IntArray etc. to IntSlice for better name hygiene.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4602054
2011-06-11 09:25:18 +10:00
Adam Langley
531c01d990 crypto/openpgp: build fix (unreviewed)
R=agl
CC=golang-dev
https://golang.org/cl/4572057
2011-06-10 13:32:20 -04:00