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

5272 Commits

Author SHA1 Message Date
Gustavo Niemeyer
9f178edf51 cgo: export unsafe.Pointer as void*
This will enable functions which use unsafe.Pointer as an argument
to be correctly exported by cgo.

R=rsc
CC=golang-dev
https://golang.org/cl/3849043
2011-01-11 11:12:06 -05:00
Gustavo Niemeyer
632be89407 cgo: output alignment fix
R=rsc
CC=golang-dev
https://golang.org/cl/3902044
2011-01-11 10:17:54 -05:00
Gustavo Niemeyer
02ff646fef cgo: fix enum const conflict
This change prevents enum consts from conflicting with themselves
when loaded twice in different go files.

Fixes #1400.

R=rsc
CC=golang-dev
https://golang.org/cl/3849044
2011-01-11 10:15:49 -05:00
Robert Griesemer
4bdaf59cc9 godoc: support for regular expression full text search
Regular expressions may now be used in conjuction with full text
search. Godoc will show the first 10000 occurences in the source
code and highlight the respective text segments.

- added new flag -testDir to specify a small directory for testing
  (fast index creation; default = "")

- use new FormatText function to format text and Go source
  code in HTML, supporting multiple kinds of text selections
  simulatenously); this replaces the uses of go/printer
  Stylers

- for now removed currently unused mechanism for identifier-
  specific JS popups (will come back in some form once we
  have type or other useful information)

- various typo fixes and minor cleanups throughout

Missing:
- indexing of non-.go files

R=r, r2
CC=golang-dev, rsc
https://golang.org/cl/3699041
2011-01-10 15:34:29 -08:00
Ken Thompson
ab4d8bf16c arm optimizer bug fixes
R=rsc
CC=golang-dev
https://golang.org/cl/3913043
2011-01-10 13:15:52 -08:00
Roger Peppe
212e074be2 time: add AfterFunc to call a function after a given duration.
The After code is trivially generalisable to provide support
for this, and it is possible to use AfterFunc to do
things that After cannot, such as waiting
for many events at varied times without an overhead
of one goroutine per event.

R=rsc, r
CC=golang-dev
https://golang.org/cl/3905041
2011-01-10 11:51:38 -08:00
Robert Griesemer
23410ced69 go/ast: correct end position for Index and TypeAssert expressions
- added position information for [ and ] brackets of Index and Slice expression nodes
- removed a TODO in go/printer

R=r, rsc
CC=golang-dev
https://golang.org/cl/3867045
2011-01-10 11:26:04 -08:00
Peter Mundy
2b0a276129 bytes: fix TrimSpace typo
Fixes #1401.

R=golang-dev, agl1
CC=golang-dev
https://golang.org/cl/3937041
2011-01-09 12:11:16 -05:00
Eoghan Sherry
0c02bd1801 time: fix tick accuracy when using multiple Tickers
* correctly ignore obsolete ticks
* fix update of next alarm time
* tighten alarm channel buffers
Fixes #1379.

R=r, adg, r2
CC=golang-dev, soul9
https://golang.org/cl/3789045
2011-01-08 21:24:44 -08:00
Ian Lance Taylor
2d39303429 runtime: Restore scheduler stack position if cgo callback panics.
If we don't do this, then when C code calls back to Go code
which panics, we lose space on the scheduler stack.  If that
happens a lot, eventually there is no space left on the
scheduler stack.

R=rsc
CC=golang-dev
https://golang.org/cl/3898042
2011-01-08 10:22:37 -08:00
Adam Langley
66a45b486b encoding/line: add
I needed a way to read lines without worrying about \n and \r\n.

R=r, rsc
CC=golang-dev
https://golang.org/cl/2859041
2011-01-08 10:29:37 -05:00
Ken Thompson
4ed17ceace add peep
R=rsc
CC=golang-dev
https://golang.org/cl/3902042
2011-01-07 18:20:26 -08:00
Ken Thompson
90ca4d75a4 initial cut at arm optimizer
R=rsc
CC=golang-dev
https://golang.org/cl/3921041
2011-01-07 18:04:48 -08:00
Rob Pike
80055c658b arm: fix build
previous version was built with -l32; should be -b32

R=ken
CC=golang-dev
https://golang.org/cl/3867044
2011-01-07 17:17:42 -08:00
Robert Griesemer
a6820b65cb gofmt: don't attempt certain illegal rewrites
(e.g.: echo 'package main' | gofmt -r 'x->7'
cannot change the package name to 7)

R=rsc
CC=golang-dev
https://golang.org/cl/3913041
2011-01-07 15:04:41 -08:00
Rob Pike
f383062e01 time.NewTicker: panic for intervals <= 0.
Not absolutely certain it's right to do this, but since there's
no error value coming back, it seems reasonable.

Fixes #1392.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/3896042
2011-01-07 14:41:46 -08:00
Rob Pike
353fd1014c bytes.Buffer: Fix bug in UnreadByte.
Error check was inverted.

Fixes #1396.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/3851042
2011-01-07 14:41:33 -08:00
Robert Griesemer
9d634e50c7 gofmt: rewriter matches apply to expressions only
Fixes #1384.

R=rsc
CC=golang-dev
https://golang.org/cl/3912041
2011-01-07 13:33:29 -08:00
Adam Langley
ee58cc799e crypto/block: mark as deprecated.
R=rsc
CC=golang-dev
https://golang.org/cl/3909041
2011-01-07 16:17:47 -05:00
Ian Lance Taylor
1b2d5b4c93 ld: Permit an ELF symbol to be exported in the dynamic symbol table.
This permits exporting crosscall2 from the runtime/cgo
package.

R=rsc
CC=golang-dev
https://golang.org/cl/3885041
2011-01-06 16:37:05 -08:00
Russ Cox
02327a72d7 cgo: disallow use of C.errno
It's incorrect, and it causes cryptic linker errors.

Fixes #1360.

R=r, r2
CC=golang-dev
https://golang.org/cl/3880041
2011-01-06 15:15:31 -05:00
Russ Cox
c1fbe589a9 Make.pkg: use installed runtime.h for cgo
Fixes #1381.

R=r, r2
CC=golang-dev
https://golang.org/cl/3775050
2011-01-06 15:15:22 -05:00
Anthony Martin
db89e19d26 runtime/cgo: fix stackguard on FreeBSD/amd64
A cursory reading of the cgo code suggests this
should be necessary, though I don't have access
to a FreeBSD machine for testing.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/3746047
2011-01-06 11:36:47 -05:00
Russ Cox
2281ca169c gc: fix &^=
Fixes #1394.

R=ken2
CC=golang-dev
https://golang.org/cl/3879041
2011-01-06 11:21:18 -05:00
Russ Cox
a46102d209 crypto/cipher: make NewCBCEncrypter return BlockMode
Fixes #1389.

R=agl1
CC=golang-dev
https://golang.org/cl/3827043
2011-01-06 11:21:04 -05:00
Kyle Consalus
754f0402c3 Made format string handling more efficient.
R=rsc, r, r2
CC=golang-dev
https://golang.org/cl/3421042
2011-01-05 11:42:35 -08:00
Russ Cox
0f26608ebc io: fix Copyn EOF handling
Fixes #1383.

R=r
CC=golang-dev
https://golang.org/cl/3821044
2011-01-05 14:35:13 -05:00
Russ Cox
189d4ff776 syscall: correct Linux Splice definition
Fixes #1376.

R=r
CC=golang-dev
https://golang.org/cl/3869042
2011-01-05 14:35:07 -05:00
Kyle Lemons
ddc2710d69 goinstall: add -clean flag
R=adg, rsc
CC=golang-dev
https://golang.org/cl/3821042
2011-01-05 14:34:59 -05:00
Anthony Martin
94df1a067c gc: return constant floats for parts of complex constants
Fixes #1369.

R=rsc
CC=golang-dev
https://golang.org/cl/3731046
2011-01-05 13:12:30 -05:00
Rob Pike
c0332fc93f fmt: normalize processing of format string
The old loop was a bit odd; change it to be more regular.
This also enables a diagnostic for Printf("%", 3): %!(NOVERB)

R=rsc, Kyle C
CC=golang-dev
https://golang.org/cl/3749044
2011-01-05 10:11:34 -08:00
Brad Fitzpatrick
d71d08af5a http: permit empty Reason-Phrase in response Status-Line
Fixes #1388.

R=rsc
CC=golang-dev
https://golang.org/cl/3749043
2011-01-05 13:09:38 -05:00
Robert Griesemer
4a7d1f2061 go/ast: correct Pos/End ranges for field lists
R=rsc
CC=golang-dev
https://golang.org/cl/3797045
2011-01-05 10:08:39 -08:00
Rob Pike
d84317ba58 gob: generate a better error message in one confusing place
(with maybe more to come) by printing a human-readable
representation of a remote type.

R=rsc
CC=golang-dev
https://golang.org/cl/3802045
2011-01-05 09:28:47 -08:00
Ian Lance Taylor
e9c4f09985 syscall: Make Access second argument consistently uint32.
Fixes #1377.

R=rsc, adg, r
CC=golang-dev
https://golang.org/cl/3868041
2011-01-04 22:28:31 -08:00
Roger Peppe
2f5a5be237 strings: fix description of FieldsFunc
R=r
CC=golang-dev
https://golang.org/cl/3814041
2011-01-04 16:23:29 -08:00
Robert Griesemer
8184778abf fix occurrences of occur[^sr .,?!;\n]
R=r, r2
CC=golang-dev
https://golang.org/cl/3794043
2011-01-04 13:16:50 -08:00
Rob Pike
6a5a527173 regexp: implement early out for failed anchored search.
R=rsc
CC=golang-dev
https://golang.org/cl/3813045
2011-01-04 12:43:52 -08:00
Patrick Gavlin
236f9638b4 encoding/binary: reject types with implementation-dependent sizes
Fixes #1201.

R=rsc
CC=golang-dev
https://golang.org/cl/3787044
2011-01-04 13:42:50 -05:00
Russ Cox
3cd10e3a0d merge tree 2011-01-04 13:40:41 -05:00
Patrick Gavlin
4e5a59591b gc: rewrite complex /= to l = l / r.
Fixes #1368.

R=rsc, ejsherry
CC=golang-dev
https://golang.org/cl/3811042
2011-01-04 13:14:17 -05:00
Robert Griesemer
9214016b3d go/ast: provide complete node text range info
- add End() method to all nodes; the text range of a node n is [n.Pos(), n.End())
- various small bug fixes in the process
- fixed several comments

R=r, rsc
CC=golang-dev
https://golang.org/cl/3769042
2011-01-04 10:14:16 -08:00
Russ Cox
71793d4b42 strconv: update ftoa comment for 'E' and 'G'
Inspired by 3827042.

R=gri, peterGo
CC=golang-dev
https://golang.org/cl/3858042
2011-01-04 13:13:12 -05:00
Michael Hoisie
ed1cbca81f net: fix close of Listener
Fixes #1375.

R=rsc, r
CC=golang-dev
https://golang.org/cl/3731048
2011-01-04 11:55:13 -05:00
Gustavo Niemeyer
5530bf90cd goinstall: fix -u for bzr
Changeset 7012:65601d7cac9e broke goinstall -u for bzr
branches.  This will fix it.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/3852041
2011-01-04 14:22:18 +11:00
Rob Pike
15cb7ed34f regexp: fix prefix bug.
After a prefix match, the old code advanced the length of the
prefix.  This is incorrect since the full match might begin
in the middle of the prefix. (Consider "aaaab+" matching
"aaaaaab").

Fixes #1373

R=rsc
CC=golang-dev
https://golang.org/cl/3795044
2011-01-03 11:35:34 -08:00
Rob Pike
c0d0d4ef05 regexp: fix performance bug, make anchored searches fail fast.
The bug was that for an anchored pattern such as ^x, the prefix
scan ignored the anchor, and could scan the whole file if there was
no x present.  The fix is to do prefix matching after the anchor;
the cost miniscule; the speedups huge.

R=rsc, gri
CC=golang-dev
https://golang.org/cl/3837042
2011-01-03 11:31:51 -08:00
Anschel Schaffer-Cohen
84fc1e20f1 Fix documentation typo.
This is really insignificant, but it might as well be fixed.

R=golang-dev, brainman
CC=golang-dev
https://golang.org/cl/3832045
2010-12-31 10:37:55 +11:00
Stefan Nilsson
834fda37c5 atof: added 'E' as valid token for exponent
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/3827042
2010-12-27 10:12:10 -08:00
Sebastien Binet
33145c4868 simple fix to not have 'exp/eval' panic in presence of slices like s[:2]
R=golang-dev, gri
CC=binet, golang-dev
https://golang.org/cl/3782044
2010-12-27 10:05:32 -08:00
Adam Langley
03e259664f crypto/cipher: fix OCFB
I messed up when reading the OCFB spec.

TBR=rsc

R=rsc
CC=golang-dev
https://golang.org/cl/3739042
2010-12-27 12:55:49 -05:00
Caine Tighe
784788ba44 goinstall/download.go: Add checkout concept and helper functions to clean and fix implementation (Issue 1265)
R=rsc, niemeyer, adg
CC=golang-dev
https://golang.org/cl/3536041
2010-12-24 11:48:45 +11:00
Andrew Gerrand
2cf6c6eb80 6l: fix documentation of -L flag
R=rsc, iant2, iant
CC=golang-dev
https://golang.org/cl/3802044
2010-12-24 09:04:53 +11:00
Eoghan Sherry
04a231d406 testing: fix error message on invalid regexp
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/3831041
2010-12-23 11:40:10 +11:00
Nigel Tao
ea70b0d51d hash/crc64: fix typo in Sum.
R=agl1
CC=golang-dev
https://golang.org/cl/3772043
2010-12-22 10:28:22 +11:00
Stefan Nilsson
8cfd9e0676 bufio: removed dead code
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/3779043
2010-12-22 08:43:35 +11:00
Rob Pike
d3866ddc65 template: fix trivial bug: integers are not "empty"
Fixes #1357.

R=adg, gri
CC=golang-dev
https://golang.org/cl/3809041
2010-12-20 13:36:47 -08:00
David Symonds
8bfa9175a3 expvar: quote StringFunc output, same as String output.
R=adg
CC=golang-dev
https://golang.org/cl/3797041
2010-12-20 17:35:21 +11:00
Robert Griesemer
2662b99f39 suffixarray: implememted FindAllIndex regexp search
Implementation uses fast suffixarray lookup to find
initial matches if the regular expression starts with
a suitable prefix without meta characters.

R=r, rsc
CC=golang-dev
https://golang.org/cl/3720042
2010-12-17 14:00:46 -08:00
Robert Griesemer
8f68b23b8d go/scanner: interpret filenames in //line filename:line comments
relative to the source file directory

R=r, rsc
CC=golang-dev
https://golang.org/cl/3752041
2010-12-17 13:54:37 -08:00
Rob Pike
ae6bfe3687 tls: fix argument mistake in Error call.
R=agl, agl1, rsc
CC=golang-dev
https://golang.org/cl/3753041
2010-12-17 13:47:52 -08:00
Rob Pike
18b39f20ef json: fix Fatal call in test
R=rsc
CC=golang-dev
https://golang.org/cl/3751041
2010-12-17 13:43:59 -08:00
Russ Cox
3832389036 fix cgo build
R=r
CC=golang-dev
https://golang.org/cl/3750041
2010-12-17 13:22:20 -08:00
Russ Cox
6c6d53052e cgo: handle references to symbols in shared libraries
Fixes #1334.

R=r
CC=golang-dev
https://golang.org/cl/3746041
2010-12-17 11:37:11 -08:00
Rob Pike
a9e7c9381e regexp: change Expr() to String(); add HasOperator method to Regexp.
It reports whether a regular expression has operators
as opposed to matching literal text.

R=rsc, gri
CC=golang-dev
https://golang.org/cl/3731041
2010-12-17 10:23:46 -08:00
Russ Cox
8ec6f7cd11 ld: ignore stab symbols
Makes 6l work better on OS X 10.5.

Fixes #1352.
Fixes #1353.

R=r
CC=golang-dev
https://golang.org/cl/3661042
2010-12-17 10:03:43 -08:00
Russ Cox
01464cf956 ld: allow relocations pointing at ELF .bss symbols
R=r, r2
CC=golang-dev
https://golang.org/cl/3710042
2010-12-17 09:53:50 -08:00
Russ Cox
0cd3475386 misc/cgo/life: fix, add to build
#pragma dynexport is no longer needed for
this use of cgo, since the gcc and gc code are
now linked together into the same binary.
It may still be necessary later.

On the Mac, you cannot use the GOT to resolve
symbols that exist in the current binary, so 6l and 8l
translate the GOT-loading mov instructions into lea
instructions.

On ELF systems, we could use the GOT for those
symbols, but for consistency 6l and 8l apply the
same translation.

The translation is sketchy in the extreme
(depending on the relocation being in a mov
instruction) but it verifies that the instruction
is a mov before rewriting it to lea.

Also makes typedefs global across files.

Fixes #1335.
Fixes #1345.

R=iant, r
CC=golang-dev
https://golang.org/cl/3650042
2010-12-17 09:51:55 -08:00
Anthony Martin
a890d70cc1 crypto/hmac: add HMAC-SHA256
R=agl1, rsc
CC=golang-dev
https://golang.org/cl/3730041
2010-12-17 12:19:37 -05:00
Rob Pike
5bd4094d2e regexp: add HasMeta and regexp.Expr().
The former is a boolean function to test whether a string
contains a regular expression metacharacter; the second
returns the string used to compile the regexp.

R=gri, rsc
CC=golang-dev
https://golang.org/cl/3728041
2010-12-16 16:55:26 -08:00
Adam Langley
be45ba712b crypto/tls: missed a file
R=rsc
CC=golang-dev
https://golang.org/cl/3674043
2010-12-16 17:14:02 -05:00
Adam Langley
4883b73982 crypto/tls: add ECDHE support
(ECDHE is "Elliptic Curve Diffie Hellman Ephemeral")

R=rsc
CC=golang-dev
https://golang.org/cl/3668042
2010-12-16 17:10:50 -05:00
Rob Pike
2e8be52ff7 time: explain the formats a little better.
R=gri, rsc
CC=golang-dev
https://golang.org/cl/3719042
2010-12-16 13:25:41 -08:00
Adam Langley
1e3b9524d2 crypto/elliptic: add serialisation and key pair generation.
This is a prerequisite to ECDHE support in crypto/tls.

R=r, rsc
CC=golang-dev
https://golang.org/cl/3685043
2010-12-16 16:04:01 -05:00
Russ Cox
b3e8fdce8d darwin, freebsd: ignore write failure (during print, panic)
The other operating systems already ignore write failures.

Fixes #1279.

R=r, r2
CC=golang-dev
https://golang.org/cl/3723041
2010-12-16 12:46:56 -08:00
Christopher Wedgwood
678a70e3b6 govet: fix comment
R=r, r2
CC=golang-dev
https://golang.org/cl/3712041
2010-12-16 12:35:38 -08:00
Adam Langley
fd021cbe8f crypto/tls: check in support code.
This support code helps in generating the handshake scripts
which are used for testing.

R=rsc, ality
CC=golang-dev
https://golang.org/cl/3680041
2010-12-16 10:39:53 -05:00
Nigel Tao
0bf2aa1aa7 exp/draw: remove Border function.
It was only used by exp/4s, and even if it is general purpose, I think
it belongs in a graphics library atop exp/draw, not in exp/draw itself.

R=rsc
CC=golang-dev
https://golang.org/cl/3705041
2010-12-16 15:11:10 +11:00
Russ Cox
1116ec4f20 ld: text segment should not be writable
R=adg
CC=golang-dev
https://golang.org/cl/3708041
2010-12-15 19:29:53 -08:00
Alex Brainman
f8b7eda5f6 8l: remove unneeded windows check
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/3691042
2010-12-16 12:19:59 +11:00
Alex Brainman
c83451971e runtime: move windows goargs implementation from runtime and into os package
R=rsc
CC=golang-dev
https://golang.org/cl/3702041
2010-12-16 12:18:18 +11:00
Alex Brainman
bb53b1c250 build: add another --no-print-directory
Fixes #1344.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/3584042
2010-12-16 10:46:25 +11:00
Russ Cox
1063ed8f3b 5l: fix arm build
R=r
CC=golang-dev
https://golang.org/cl/3701041
2010-12-15 14:57:49 -08:00
Russ Cox
33405ecc86 fix freebsd build
R=iant, r
CC=dho, golang-dev
https://golang.org/cl/3687041
2010-12-15 17:20:26 -05:00
Adam Langley
1a072f4b37 crypto/tls: commit fixes which I hadn't saved.
R=rsc
CC=golang-dev
https://golang.org/cl/3685041
2010-12-15 13:58:57 -05:00
Eoghan Sherry
976e45726c math: change float64 bias constant from 1022 to 1023
This makes some subtle code easier to understand.

R=rsc
CC=golang-dev
https://golang.org/cl/3444043
2010-12-15 13:20:52 -05:00
Adam Langley
eedf5c4529 crypto/tls: support CBC ciphers
This is largely based on ality's CL 2747042.

crypto/rc4: API break in order to conform to crypto/cipher's
Stream interface

cipher/cipher: promote to the default build

Since CBC differs between TLS 1.0 and 1.1, we downgrade and
support only 1.0 at the current time. 1.0 is what most of the
world uses.

Given this CL, it would be trival to add support for AES 256,
SHA 256 etc, but I haven't in order to keep the change smaller.

R=rsc
CC=ality, golang-dev
https://golang.org/cl/3659041
2010-12-15 11:49:55 -05:00
Russ Cox
0c54225b51 remove nacl
The recent linker changes broke NaCl support
a month ago, and there are no known users of it.

The NaCl code can always be recovered from the
repository history.

R=adg, r
CC=golang-dev
https://golang.org/cl/3671042
2010-12-15 11:49:23 -05:00
Luuk van Dijk
7a4ce23d65 [68]l and runtime: GDB support for interfaces and goroutines.
R=rsc
CC=golang-dev
https://golang.org/cl/3477041
2010-12-15 12:00:43 +01:00
Nigel Tao
d96685ed6a reflect: remove unnecessary indirection in TestCopy.
R=r
CC=golang-dev
https://golang.org/cl/3642041
2010-12-15 20:54:11 +11:00
Rob Pike
670e77b54d govet: allow directories as arguments, process recursively.
R=gri
CC=golang-dev
https://golang.org/cl/3652041
2010-12-14 17:09:24 -08:00
Nigel Tao
fec6ab9726 html: parse "<h1>foo<h2>bar".
R=gri
CC=golang-dev
https://golang.org/cl/3571043
2010-12-15 11:39:56 +11:00
Rob Pike
8132bb1c74 gob: Register should use the original type, not the indirected one.
Fixes a bug reported on golang-nuts.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/3641042
2010-12-14 15:04:52 -08:00
Christopher Wedgwood
56452c53ee govet: on error continue to the next file
R=r, rsc
CC=golang-dev
https://golang.org/cl/3578041
2010-12-14 14:12:22 -08:00
Rob Pike
9f6de01d8d gob: document the byte count used in the encoding of values.
R=rsc
CC=golang-dev
https://golang.org/cl/3641041
2010-12-14 14:04:52 -08:00
Nigel Tao
8b64cd9c5e reflect: add Append and AppendSlice functions.
R=r, nigeltao_gnome, rog, niemeyer
CC=golang-dev
https://golang.org/cl/3529042
2010-12-15 08:50:08 +11:00
Rob Pike
da1cbe5d11 regexp: simplify code for brackets, per rsc suggestion
R=rsc
CC=golang-dev
https://golang.org/cl/3545044
2010-12-14 12:01:35 -08:00
Russ Cox
f620a430f2 compress/flate: implement Flush
This Flush is equivalent to zlib's Z_SYNC_FLUSH.
The addition of the explicit Writer type opens the
door to adding a PartialFlush if needed for SSH
and maybe even FullFlush.  It also opens the door
for a SetDictionary method to be added.

http://www.bolet.org/~pornin/deflate-flush.html
documents the various intricacies of flushing a
DEFLATE stream.

R=agl1, r
CC=golang-dev
https://golang.org/cl/3637041
2010-12-14 14:57:12 -05:00
Rob Pike
8bb9e616ed regexp: speed up by about 30%.
The code used interfaces in a pretty, pedagogical way but not efficiently.
Remove unnecessary interface code for significant speedups.
Before:

	regexp.BenchmarkLiteral	 1000000	      2629 ns/op
	regexp.BenchmarkNotLiteral	  100000	     18131 ns/op
	regexp.BenchmarkMatchClass	  100000	     26647 ns/op
	regexp.BenchmarkMatchClass_InRange	  100000	     27092 ns/op
	regexp.BenchmarkReplaceAll	  100000	     27014 ns/op

After:

	regexp.BenchmarkLiteral	 1000000	      2077 ns/op
	regexp.BenchmarkNotLiteral	  100000	     13738 ns/op
	regexp.BenchmarkMatchClass	  100000	     20418 ns/op
	regexp.BenchmarkMatchClass_InRange	  100000	     20999 ns/op
	regexp.BenchmarkReplaceAll	  100000	     21825 ns/op

There's likely more to do without major surgery, but this is a simple, significant step.

R=rsc
CC=golang-dev
https://golang.org/cl/3572042
2010-12-14 11:15:32 -08:00
Robert Griesemer
3fb6d62e3a suffixarray: rename Data() -> Bytes()
R=rsc
CC=golang-dev
https://golang.org/cl/3540042
2010-12-14 10:22:00 -08:00
Anthony Martin
d7340d9c20 http: include DEL in the test for unprintable chars
R=adg, rsc
CC=golang-dev
https://golang.org/cl/3631041
2010-12-14 12:26:30 -05:00
Anthony Martin
add32466bf build: remove intermediate yacc files in Make.ccmd
R=rsc
CC=golang-dev
https://golang.org/cl/3545042
2010-12-14 12:22:40 -05:00
Anthony Martin
6a4b0191c0 crypto/tls: use rand.Reader in cert generation example
R=rsc, agl1
CC=golang-dev
https://golang.org/cl/3536043
2010-12-14 12:22:28 -05:00
Anthony Martin
11b49ff124 smtp: add *tls.Config argument to StartTLS
R=rsc, agl1
CC=golang-dev
https://golang.org/cl/3573044
2010-12-14 12:22:08 -05:00
Russ Cox
d110ae8dd0 runtime: write only to standard error
Will mail a warning to golang-nuts once this is submitted.

R=r, niemeyer
CC=golang-dev
https://golang.org/cl/3573043
2010-12-14 11:52:42 -05:00
Robert Griesemer
6fcae0f044 token/position: provide files iterator
R=golang-dev, r2
CC=golang-dev
https://golang.org/cl/3541044
2010-12-13 17:08:40 -08:00
Robert Griesemer
52c9fb6f3d suffixarray: provide accessor to data
R=r
CC=golang-dev
https://golang.org/cl/3574044
2010-12-13 17:08:01 -08:00
Russ Cox
951318c0df runtime: remove paranoid mapping at 0
Too many programs complain that we even try.
This was a bit of security paranoia and not worth
the bother.

Fixes #1340.

R=r, r2
CC=golang-dev
https://golang.org/cl/3579042
2010-12-13 16:57:35 -05:00
Rob Pike
2ef09148a0 time: fix bug in Ticker: shutdown using channel rather than memory
R=rsc
CC=golang-dev
https://golang.org/cl/3609042
2010-12-13 13:52:19 -08:00
Russ Cox
1b31c37428 gc: issue 1231
Fixes #1231.

R=ken2
CC=golang-dev
https://golang.org/cl/3627041
2010-12-13 16:51:19 -05:00
Russ Cox
dc9a3b2791 gc: align structs according to max alignment of fields
cc: same
runtime: test cc alignment (required moving #define of offsetof to runtime.h)
fix bug260

Fixes #482.
Fixes #609.

R=ken2, r
CC=golang-dev
https://golang.org/cl/3563042
2010-12-13 16:22:19 -05:00
Russ Cox
287e45e241 json: check for invalid UTF-8
Fixes #1250.

R=r
CC=golang-dev
https://golang.org/cl/3562042
2010-12-13 15:51:11 -05:00
Russ Cox
3a2ba994b6 build: add a few missing --no-print-directory
Reported by W. Michael Petullo <mike@flyn.org>

Fixes #1269.

R=r, r2
CC=golang-dev
https://golang.org/cl/3618041
2010-12-13 15:50:57 -05:00
Russ Cox
318c1eeb32 godefs: guard against structs with pad fields
Fixes #1162.

R=r
CC=golang-dev
https://golang.org/cl/3619041
2010-12-13 15:50:47 -05:00
Russ Cox
9e26c4bd1a gc: complex(0)
Fixes #1232.

R=ken2
CC=golang-dev
https://golang.org/cl/3621041
2010-12-13 15:34:45 -05:00
Russ Cox
88cf5564fc ld: missing prototype
R=ken2
CC=golang-dev
https://golang.org/cl/3620041
2010-12-13 15:26:52 -05:00
Russ Cox
603f9feeec gc: another shift bug
Fixes #1316.

R=ken2
CC=golang-dev
https://golang.org/cl/3575042
2010-12-13 13:42:51 -05:00
Russ Cox
9da73612ed cgo: do not reset tag generator between files
Clean up an error message and error exit too.
Insert blank line after "DO NOT EDIT" comment
to keep it from being a doc comment.

Fixes #1213.
Fixes #1222.

R=r
CC=golang-dev
https://golang.org/cl/3608042
2010-12-13 13:20:04 -05:00
Russ Cox
e7a0f67603 gc: introduce explicit alignments
No semantic changes here, but working
toward being able to align structs based
on the maximum alignment of the fields
inside instead of having a fixed alignment
for all structs (issue 482).

R=ken2
CC=golang-dev
https://golang.org/cl/3617041
2010-12-13 11:57:41 -05:00
Russ Cox
96db724cfc gc: emit reflect correct reflect types
Fixes #1169.

R=ken2
CC=golang-dev
https://golang.org/cl/3595043
2010-12-13 10:05:20 -05:00
Russ Cox
c7c16175e0 ld: allow .o files with no symbols
Don't crash in dwarf for foreign functions.

R=ken2
CC=golang-dev
https://golang.org/cl/3576043
2010-12-13 10:05:07 -05:00
Russ Cox
cc1556d9a2 runtime/linux/386: set FPU to 64-bit precision
Fixes #550.

R=r
CC=golang-dev
https://golang.org/cl/3469044
2010-12-13 10:04:53 -05:00
Alex Brainman
84713d46f6 syscall: remove terminating \r and \n from windows error messages
R=rsc, peterGo
CC=golang-dev
https://golang.org/cl/3095042
2010-12-13 17:02:01 +11:00
Wei Guangjing
e04ef7769e Fix windows build.
R=brainman, rsc
CC=golang-dev
https://golang.org/cl/3533041
2010-12-13 16:41:02 +11:00
Gustavo Niemeyer
1f6b6ca9ba A selection of trivials.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/3606043
2010-12-12 14:16:37 -08:00
Robert Griesemer
5e54e93675 godoc: improved textual search
- improved search result page
- clicking on files shows highlighted search phrase
  (.go files loose their godoc-specific formatting and
  highlighting in this mode - a better solution is in
  the works)
- support for textual results
- fixed bug with non-URL escaped URL parameter (Query)

R=rsc, adg
CC=golang-dev
https://golang.org/cl/3585041
2010-12-12 13:13:07 -08:00
Eoghan Sherry
40ff071e9b 5g/8g, 8l, ld, prof: fix output of 32-bit values
If an %lld argument can be 32 or 64 bits wide, cast to vlong.
If always 32 bits, drop the ll.
Fixes #1336.

R=brainman, rsc
CC=golang-dev
https://golang.org/cl/3580041
2010-12-12 14:40:19 -05:00
Nigel Tao
73fd298901 reflect: rename reflect.ArrayCopy to be reflect.Copy.
R=r
CC=golang-dev
https://golang.org/cl/3601041
2010-12-12 20:27:29 +11:00
Mikio Hara
7ec69c179d gofmt -s -w src
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/3592041
2010-12-11 13:49:45 -08:00
Robert Griesemer
055650daa4 godoc: first cut at textual search
To enable use -fulltext flag; e.g.: godoc -v -fulltext -http=:7777

Enabling the fulltext index will use significantly more memory as
the text of all source code, the respective suffixarray, and the
file set data structure is kept in memory. At the moment there is
about 6Mb of source code (~1400 files) indexed under GOROOT.
Source code + suffix array together consume 5*(size of source) or
about 30Mb. The file set data structure consumes about 4b/src line.
By default only up to 5000 results are shown for now.

The presentation of the results needs tuning. In particular,
if a string is found, clicking on the respective file does not
highlight them, yet.

At the moment, only Go source files are indexed. Eventually,
the full text index should encompass other files as well.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/3182043
2010-12-10 14:40:22 -08:00
Russ Cox
9282a768cf math: s/MinFloat/SmallestNonzeroFloat/
R=r, gri
CC=golang-dev
https://golang.org/cl/3547042
2010-12-10 11:39:09 -08:00
Russ Cox
e454af4d64 cgo: avoid self-interference of global names
Fixes #1332.

R=iant, iant2
CC=golang-dev
https://golang.org/cl/3555041
2010-12-10 11:32:58 -08:00
Russ Cox
4324a31376 nm: silently ignore .o files in .a files
Update #1334.

R=r
CC=golang-dev
https://golang.org/cl/3553041
2010-12-10 11:32:48 -08:00
Nigel Tao
71bd053ada html: parse <table><tr><td> tags.
Also, shorten fooInsertionMode to fooIM.

R=gri
CC=golang-dev
https://golang.org/cl/3504042
2010-12-10 12:20:14 +11:00
Ryan Hitchman
8959851a96 os: make MkdirAll work with symlinks
Fixes #1149.

R=adg
CC=golang-dev
https://golang.org/cl/3564041
2010-12-10 10:43:45 +11:00
Ken Thompson
ae60526848 arm floating point simulation
R=rsc
CC=golang-dev
https://golang.org/cl/3565041
2010-12-09 14:45:27 -08:00
Andrew Gerrand
aa9c213e56 http: ServeFile to handle Range header for partial requests
and send Content-Length.

Also includes some testing of the server code.

R=rsc
CC=golang-dev
https://golang.org/cl/2831041
2010-12-10 08:51:13 +11:00
Nigel Kerr
27f2d5ce8c xml: disallow invalid Unicode code points
Fixes #1259.

R=rsc
CC=golang-dev
https://golang.org/cl/2967041
2010-12-09 14:51:01 -05:00
Russ Cox
92b4506f73 os: fix test of RemoveAll
Fixes #22. (again)

R=r
CC=golang-dev
https://golang.org/cl/3547041
2010-12-09 14:49:13 -05:00
Mikio Hara
6555cfc6c6 syscall: add network interface constants for linux/386, linux/amd64
R=rsc
CC=golang-dev
https://golang.org/cl/3266042
2010-12-09 13:55:59 -05:00
Ryan Hitchman
f980577064 gc: syntax error for incomplete chan type
Fixes #932.

R=rsc
CC=golang-dev
https://golang.org/cl/3515041
2010-12-09 13:41:24 -05:00
Robert Griesemer
e1d6b3c98d go/ast: fix ast.Walk
- change Walk signature to use an ast.Node instead of interface{}
- add Pos functions to a couple of ast types to make them proper nodes
- explicit nil checks where a node can be nil; incorrect ASTs cause Walk to crash

For now ast.Walk is exercised extensively as part of godoc's indexer;
so we have some confidence in its correctness. But this needs a test,
eventually.

Fixes #1326.

R=rsc, r
CC=golang-dev
https://golang.org/cl/3481043
2010-12-09 10:22:01 -08:00
Robert Griesemer
e2da3b6498 gofmt: simplify "x, _ = range y" to "x = range y"
(inspired by CL 3529041 by hitchmanr@gmail.com)

R=rsc
CC=golang-dev
https://golang.org/cl/3527042
2010-12-09 10:11:57 -08:00
Balazs Lecz
2bdb2e78fe os/inotify: new package
This patch adds a new package: os/inotify, which
provides a Go wrapper to the Linux inotify system.

R=rsc, albert.strasheim, rog, jacek.masiulaniec
CC=golang-dev
https://golang.org/cl/2049043
2010-12-09 13:11:39 -05:00
Robert Griesemer
b98fffe39e go/token,scanner: fix comments so godoc aligns properly
R=iant, r2
CC=golang-dev
https://golang.org/cl/3532042
2010-12-09 10:11:00 -08:00
Rob Pike
8e609cddef govet: a new static checker for Go programs.
At the moment, and for the forseeable future, it only checks arguments to print calls.

R=rsc, gri, niemeyer, iant2, rog, lstoakes, jacek.masiulaniec, cw
CC=golang-dev
https://golang.org/cl/3522041
2010-12-09 12:37:18 -05:00
Rob Pike
b7c73110b1 gob: fix bug sending zero-length top-level slices and maps
Fixes #1278.

R=rsc
CC=golang-dev
https://golang.org/cl/3434046
2010-12-09 11:01:32 -05:00
Ryan Hitchman
062406bc64 throughout: simplify two-variable ranges with unused second variable
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/3529041
2010-12-08 21:36:56 -08:00
Rob Pike
14804a412b event.go: another print glitch from gocheck.
R=rsc
CC=golang-dev
https://golang.org/cl/3524041
2010-12-08 17:12:25 -05:00
Russ Cox
85d9ab61d2 arm: more fixes
R=ken2
CC=golang-dev
https://golang.org/cl/3523041
2010-12-08 16:49:49 -05:00
Russ Cox
7eeebf49be runtime/cgo: adapt files copied from libcgo
Necessary but not sufficient step toward
making those builds work.

R=r
CC=golang-dev
https://golang.org/cl/3411043
2010-12-08 16:35:05 -05:00
Rob Pike
70113b436e a few more errors caught by the print checker
R=rsc
CC=golang-dev
https://golang.org/cl/3431046
2010-12-08 16:25:14 -05:00
Russ Cox
839abc2ea7 5l (and 6l, 8l, ld): more arm build fixes
R=ken2
CC=golang-dev
https://golang.org/cl/3521041
2010-12-08 15:44:59 -05:00
Russ Cox
b8562ff488 5l: fix build
Makes 5l build with recent changes, but not yet tested on ARM hardware.

R=ken2
CC=golang-dev
https://golang.org/cl/3449044
2010-12-08 15:37:51 -05:00
Adam Langley
3a5efdf230 crypto/elliptic: remove mistakenly commited code
One of my own experiments ended up getting mistakenly commited when
        switching to Jacobian transformations.

R=rsc
CC=golang-dev
https://golang.org/cl/3473044
2010-12-08 15:01:53 -05:00
Russ Cox
5a8f2ba727 fix build: more libcgo references
R=r
CC=golang-dev
https://golang.org/cl/3448043
2010-12-08 14:36:45 -05:00
Russ Cox
98b2d7062e libcgo: delete (replaced by runtime/cgo)
Move unported files (freebsd*, windows*, nacl*) to runtime/cgo.

Step toward fixing FreeBSD build.

R=r
TBR=r
CC=golang-dev
https://golang.org/cl/3497042
2010-12-08 14:33:17 -05:00
Russ Cox
66f7463e80 syscall: fix linux/arm build
bug introduced at
https://golang.org/cl/2331044

R=ken2
CC=golang-dev
https://golang.org/cl/3440046
2010-12-08 14:31:46 -05:00
Russ Cox
b07b04d35f runtime/cgo: take 2
This is a second attempt at submitting
https://golang.org/cl/3420043

A Mercurial problem lost the new files
in that submit.

TBR=r
CC=golang-dev
https://golang.org/cl/3511043
2010-12-08 14:10:00 -05:00
Russ Cox
14d677ecba cgo: new cgo
Very few changes here: the subtle ones are in Make.pkg.

Note that incredibly (and importantly) there are
no changes necessary to the test programs in misc/cgo.

R=iant
CC=golang-dev
https://golang.org/cl/3504041
2010-12-08 13:56:51 -05:00
Russ Cox
f5690004c2 6l, 8l: support for linking ELF and Mach-O .o files
More support for references to dynamic symbols,
including full GOT and PLT for ELF objects.

For Mach-O everything ends up in the GOT: dealing
with the real lazy PLT is too hard for now so we punt.

R=iant, iant2
CC=golang-dev
https://golang.org/cl/3491042
2010-12-08 13:56:43 -05:00
Russ Cox
9042c2ce68 runtime/cgo: runtime changes for new cgo
Formerly known as libcgo.
Almost no code here is changing; the diffs
are shown relative to the originals in libcgo.

R=r
CC=golang-dev
https://golang.org/cl/3420043
2010-12-08 13:53:30 -05:00
Russ Cox
cf42a45587 ld: reading of Mach-O object files
R=iant
CC=golang-dev
https://golang.org/cl/3431045
2010-12-08 13:53:24 -05:00
Russ Cox
37499ebcfd debug/elf, debug/macho: add ImportedLibraries, ImportedSymbols
R=r, iant
CC=golang-dev
https://golang.org/cl/3470044
2010-12-08 13:53:19 -05:00
Russ Cox
f16c280fe5 gopack: allow ELF/Mach-O objects in .a files without clearing allobj
R=iant
CC=golang-dev
https://golang.org/cl/3503041
2010-12-08 13:53:13 -05:00
Russ Cox
8132f1d016 6l, 8l: minor changes & cleanup
R=ken2, ken3
CC=golang-dev
https://golang.org/cl/3505041
2010-12-08 13:53:07 -05:00
Russ Cox
4d8d6d5cda ld: reading of ELF object files
R=iant
CC=golang-dev
https://golang.org/cl/3507041
2010-12-08 13:52:59 -05:00
Russ Cox
7431a3165e ld: re-add ELF symbol tables
R=iant
CC=golang-dev
https://golang.org/cl/3506041
2010-12-08 13:52:50 -05:00
Rob Pike
0313ea80ab path: fix printf glitch in test
R=rh, gri
CC=golang-dev
https://golang.org/cl/3514041
2010-12-08 09:58:46 -05:00
Robert Griesemer
4ba27e27f3 godoc: use file instead of file set for computing line info
Reduces indexing time by ~10%; from ~44s to ~39s, best of 3 runs.

R=rsc
CC=golang-dev
https://golang.org/cl/3510041
2010-12-07 21:55:32 -08:00
Robert Griesemer
1612b8734a token/position.go: provide FileSet.File(), minor optimizations
R=rsc
CC=golang-dev
https://golang.org/cl/3399042
2010-12-07 21:50:08 -08:00
Alex Brainman
1e2876469b syscall: restrict access rights param of OpenProcess() to the minimum needed
Fixes #1270.

R=vcc, rsc
CC=golang-dev
https://golang.org/cl/3299041
2010-12-08 16:20:30 +11:00
Alex Brainman
60c91bbf4c runtime: fix windows build
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/3419043
2010-12-08 12:52:36 +11:00
Keith Rarick
51a2183851 runtime: add Goroutines
R=rsc
CC=golang-dev
https://golang.org/cl/3508041
2010-12-07 18:06:31 -05:00
Eoghan Sherry
63544c4754 ld: fix dwarf decoding of 64-bit reflect values
R=rsc
CC=golang-dev
https://golang.org/cl/3002041
2010-12-07 17:20:52 -05:00
Russ Cox
7e14bd81f4 runtime: debugging help on 386
R=r
CC=golang-dev
https://golang.org/cl/3502041
2010-12-07 17:19:36 -05:00
Nigel Tao
49014c5b12 html: handle unexpected EOF during parsing.
This lets us parse HTML like "<html>foo".

R=gri
CC=golang-dev
https://golang.org/cl/3460043
2010-12-08 08:59:20 +11:00
Russ Cox
8d50557979 cc: allow $ as letter in pragma arguments
(Needed for Mac OS X symbol names.)

R=ken2
CC=golang-dev
https://golang.org/cl/3499041
2010-12-07 16:45:06 -05:00
Robert Griesemer
ce89f213a8 go/parser: Better comment for ParseFile.
The name ParseFile was kept as it indicates that
this function parses a Go 'SourceFile' per the
Go spec. Similarly, the other functions (ParseExpr,
ParseStmtList, ParseDeclList) parse the corresponding
constructs as defined in the Go spec.

Fixes #1311.

R=r, rsc
CC=golang-dev
https://golang.org/cl/3453042
2010-12-07 13:44:01 -08:00
Rob Pike
1ce6245d6c throughout: fix broken calls to Printf etc.
I have written a tool to verify Printf calls, and although it's not
ready to be reviewed yet it's already uncovered a spate of problems
in the repository.  I'm sending this CL to break the changes into
pieces; as the tool improves it will find more, I'm sure.

R=rsc
CC=golang-dev
https://golang.org/cl/3427043
2010-12-07 16:42:54 -05:00
Russ Cox
8694959b12 http: fix build
R=dsymonds
TBR=dsymonds
CC=golang-dev
https://golang.org/cl/3425044
2010-12-07 16:20:15 -05:00
Eoghan Sherry
cab83650d1 gc: skip undefined symbols in import .
Fixes #1284.

R=ken3, rsc
CC=golang-dev
https://golang.org/cl/3210041
2010-12-07 16:16:01 -05:00
Russ Cox
b15c4245c5 crypto/tls: add *Config argument to Dial
Document undocumented exported names.
Allow nil Rand, Time, RootCAs in Config.

Fixes #1248.

R=agl1
CC=golang-dev
https://golang.org/cl/3481042
2010-12-07 16:15:15 -05:00
Christian Himpel
2660c2a7be crypto/tls: fix build of certificate generation example
R=agl1, rsc
CC=golang-dev
https://golang.org/cl/3366041
2010-12-07 16:14:55 -05:00
Michael Hoisie
bfac91a6b9 exec.LookPath: return os.PathError instad of os.ENOENT, it's more descriptive.
R=rsc
CC=golang-dev
https://golang.org/cl/3448042
2010-12-07 15:57:00 -05:00
Nigel Tao
688a83128d html: move the sanity checking of the entity map from runtime
(during init) to test-time (via gotest).

R=gri
CC=golang-dev
https://golang.org/cl/3466044
2010-12-08 07:55:03 +11:00
David Symonds
ae2495c5b0 http: Add EncodeQuery, a handy helper function for constructing URL query strings.
R=stephenm, rsc
CC=golang-dev
https://golang.org/cl/2985042
2010-12-07 15:54:04 -05:00
Wei Guangjing
70deac67cf 8l : add dynimport to import table in Windows PE, initial make cgo dll work.
R=rsc, brainman, Joe Poirier, mattn
CC=golang-dev
https://golang.org/cl/2166041
2010-12-07 15:28:33 -05:00
Albert Strasheim
836643400c build: Allow archiver to be specified in the environment with HOST_AR.
R=rsc
CC=golang-dev
https://golang.org/cl/2515043
2010-12-07 15:28:26 -05:00
Roger Peppe
24a78a026d bufio: make Reader.Read implement io.Reader semantics
R=rsc
CC=golang-dev
https://golang.org/cl/3395042
2010-12-07 14:54:15 -05:00
Albert Strasheim
cf6c212197 syscall, net: Add Recvmsg and Sendmsg on Linux.
Working on issue 1101.

R=rsc
CC=golang-dev
https://golang.org/cl/2331044
2010-12-07 13:40:14 -05:00
Russ Cox
ed7c3f3127 flag: handle multiple calls to flag.Parse
R=r
CC=golang-dev
https://golang.org/cl/3071041
2010-12-07 13:19:01 -05:00
Robert Griesemer
14eb03f614 go/scanner: remove Tokenize() - was only used in tests
R=r
CC=golang-dev
https://golang.org/cl/3415042
2010-12-07 10:08:00 -08:00
Eoghan Sherry
6aa85d1cbe gc: fix method offsets of anonymous interfaces
Fixes #1290.

R=rsc
CC=golang-dev
https://golang.org/cl/3259043
2010-12-07 12:56:26 -05:00
Dean Prichard
cd319092e0 sync: small naming fix for armv5
R=rsc
CC=golang-dev
https://golang.org/cl/3268042
2010-12-07 12:05:00 -05:00
Andrew Gerrand
79dcf180a2 runtime: fix build for nacl
R=lvd
CC=golang-dev
https://golang.org/cl/3391044
2010-12-07 15:24:46 +11:00
Ryan Hitchman
f503e26379 html: unescape numeric entities, and complete the named entities table, including two-character entities.
Fixes #1233.

R=nigeltao
CC=golang-dev
https://golang.org/cl/3445041
2010-12-07 12:13:47 +11:00
Nigel Tao
08a47d6f60 html: first cut at a parser.
R=gri
CC=golang-dev
https://golang.org/cl/3355041
2010-12-07 12:02:36 +11:00
Robert Griesemer
2fd2991eac godoc: don't call flush if position is not valid
(fixes new godoc crash when looking at spec)

R=rsc, r, iant
CC=golang-dev
https://golang.org/cl/3488041
2010-12-06 15:34:23 -08:00
Robert Griesemer
5a9ad8b9e3 go/ast: use token.Pos instead of token.Position; adjust all dependent code
Specifically:

	* lib/godoc:
	- provide file set (FSet) argument to formatters where needed

	* src/cmd:
	- cgo, ebnflint, godoc, gofmt, goinstall: provide file set (fset) where needed
	- godoc: remove local binary search with sort.Search (change by rsc),
	  extract file set for formatters

	* src/pkg:
	- exp/eval: remove embedded token.Position fields from nodes and replace
	  with named token.Pos fields; add corresponding Pos() accessor methods
	- go/token: added file.Line(), changed signature of File.Position()

	* test/fixedbugs/:
	- bug206.go: change test to not rely on token.Pos details

	* added various extra comments
	* Runs all.bash
	* gofmt formats all of src, misc w/o changes
	* godoc runs

	* performance:
	- The new version of godoc consumes about the same space after indexing
	  has completed, but indexing is half the speed. Significant space savings
	  are expected from smaller ASTs, but since they are thrown away after a
	  file has been indexed, this is not visible anymore. The slower indexing
	  time is due to the much more expensive computation of line information.
	  However, with the new compressed position information, indexing can be
	  rewritten and simplified. Furthermore, computing the line info can be
	  done more efficiently.

        New godoc, immediately after indexing completed (best of three runs):

	  PID COMMAND      %CPU   TIME   #TH #PRTS #MREGS RPRVT  RSHRD  RSIZE  VSIZE
	44381 godoc        0.0%  0:38.00   4    19    149  145M   184K   148M   176M

	2010/12/03 17:58:35 index updated (39.231s, 18505 unique words, 386387 spots)
	2010/12/03 17:58:35 bytes=90858456 footprint=199182584
	2010/12/03 17:58:36 bytes=47858568 footprint=167295224

	Old godoc, immediately after indexing completed (best of three runs):

	  PID COMMAND      %CPU   TIME   #TH #PRTS #MREGS RPRVT  RSHRD  RSIZE  VSIZE
	23167 godoc        0.0%  0:22.02   4    17    132  129M   184K   132M   173M

	2010/12/03 14:51:32 index updated (24.892s, 18765 unique words, 393830 spots)
	2010/12/03 14:51:32 bytes=66404528 footprint=163907832
	2010/12/03 14:51:32 bytes=46282224 footprint=163907832

	The different numbers for unique words/spots stem from the fact the the
	two workspaces are not exactly identical. The new godoc maintains a large
	file set data structure during indexing which (probably) is the reason
	for the larger heap (90858456 vs 66404528) before garbage collection.

R=rsc, r
CC=golang-dev
https://golang.org/cl/3050041
2010-12-06 14:23:18 -08:00
Russ Cox
92bfd850e0 net: fix TestDialGoogle
TBR=r
CC=golang-dev
https://golang.org/cl/3417042
2010-12-06 14:07:36 -08:00
Yuval Pavel Zholkover
8221eb9103 8l, runtime: fix Plan 9 386 build.
8l was broken by commit 7ac0d2eed9, it caused .data to be page aligned in the file - which is not how Plan 9 expects things to be.
Also .rodata was layed out in a similar fashion.

Not sure when signame was introduced, but added a stub.
Removed the symo assignment in asm.c as it is not currently used.

Fix runtime breakage after commit 629c065d36 which prefixes all external symbols with runtime·.

R=rsc
CC=golang-dev
https://golang.org/cl/2674041
2010-12-06 16:38:28 -05:00
Eoghan Sherry
ff4e08f60d math: improve accuracy of Exp2
Note:
* Exp2 doesn't have a special case for very small arguments
* Exp2 hasn't been subject to a proper error analysis

Also:
* add tests for Exp2 with integer argument
* always test Go versions of Exp and Exp2

R=rsc
CC=Charlie Dorian, PeterGo, golang-dev
https://golang.org/cl/3481041
2010-12-06 16:24:51 -05:00
Russ Cox
6eee9ed507 time: fix build
Allow less precise timing on build machines.

TBR=r
CC=golang-dev
https://golang.org/cl/3391043
2010-12-06 16:22:32 -05:00
Rob Pike
42cfe48ffc use the new %U format for runes
R=rsc
CC=golang-dev
https://golang.org/cl/3483041
2010-12-06 14:38:25 -05:00
Rob Pike
53eaf40eba netchan: fix dumb locking bug introduced in recent editing.
-found by Dave Cheney

R=rsc
CC=golang-dev
https://golang.org/cl/3460042
2010-12-06 14:29:05 -05:00
Rob Pike
e26f9b3420 flag: fix format error in boolean error report. just use %q; the values are strings.
R=rsc
CC=golang-dev
https://golang.org/cl/3418043
2010-12-06 14:23:52 -05:00
Rob Pike
730e39cd13 fmt: add %U format for standard Unicode representation of integer values.
fmt.Printf("%U", 1) yields "U+0001"
It's essentially "U+%.4x" but lets you override the precision works in scan, too.

R=rsc
CC=golang-dev
https://golang.org/cl/3423043
2010-12-06 14:23:37 -05:00
Roger Peppe
e2d1595c81 time: make After use fewer goroutines and host processes.
With credit to Gustavo Niemeyer, who hinted at this approach
in #go-nuts.

R=adg, rsc, niemeyer, r
CC=golang-dev
https://golang.org/cl/3416043
2010-12-06 14:19:30 -05:00
Roger Peppe
415545e539 bytes: add Buffer.UnreadRune, Buffer.UnreadByte
R=rsc, r
CC=golang-dev
https://golang.org/cl/3421041
2010-12-06 14:10:10 -05:00
Luuk van Dijk
9a71bb00bb [68]l: generate debug info for builtin structured types. prettyprinting in gdb.
R=rsc
CC=golang-dev
https://golang.org/cl/3309041
2010-12-03 19:19:33 +01:00
Jamie Gennis
b88b38ac12 go/printer: preserve newlines in func parameter lists
Fixes #1179.

R=gri
CC=golang-dev
https://golang.org/cl/3225042
2010-12-02 10:42:10 -08:00
Stefan Nilsson
6f1835dce0 Sort: reduced stack depth to lg(n) in quickSort
Doing the tail recursion elimination explicitly
seems safer than leaving it to the compiler;
the code is still clean and easy to understand.

R=r, r2, gri
CC=golang-dev
https://golang.org/cl/3373041
2010-12-02 09:18:20 -08:00
Brad Fitzpatrick
042a7a81d3 http: consume request body before next request
Fixes #1306.

R=rsc
CC=golang-dev
https://golang.org/cl/3332043
2010-12-01 20:00:19 -08:00
Rob Pike
5e4882a325 template: implement multi-word variable instantation for formatters.
Before one could say
	{field}
or
	{field|formatter}
Now one can also say
	{field1 field2 field3}
or
	{field1 field2 field3|formatter}
and the fields are passed as successive arguments to the formatter,
analogous to fmt.Print.

R=rsc, gri
CC=golang-dev
https://golang.org/cl/3385041
2010-12-01 17:10:40 -08:00
Rob Pike
d1524217df template: change the signature of formatters for future development.
Make them more like Printf, with a ... final argument.  This breaks
code with existing formatters but not the templates that use them.

R=rsc, gri
CC=golang-dev
https://golang.org/cl/3378041
2010-12-01 13:33:49 -08:00
Kyle Consalus
009aebdba8 Removed bytes.Add and bytes.AddByte; we now have 'append'.
Changed all uses of bytes.Add (aside from those testing bytes.Add) to append(a, b...).
Also ran "gofmt -s" and made use of copy([]byte, string) in the fasta benchmark.

R=golang-dev, r, r2
CC=golang-dev
https://golang.org/cl/3302042
2010-12-01 11:59:13 -08:00
Roger Peppe
1f90447e31 log: ensure writes are atomic.
This means that any Writer can be used safely
even when Output is called concurrently.
Fixes #1302.

R=r, nigeltao_gnome
CC=golang-dev
https://golang.org/cl/3300042
2010-12-01 10:15:42 -08:00
Benny Siegert
b06dc26a58 path: Windows support for Split
Make Split work on backslashes as well as on slashes under Windows
and support the "C:filename" special case. Also add corresponding
tests.

R=r, rsc, PeterGo, r2, brainman
CC=golang-dev
https://golang.org/cl/3008041
2010-11-30 17:17:45 -08:00
Luuk van Dijk
555feea117 runtime: fix windows breakage
R=iant
CC=golang-dev
https://golang.org/cl/3344044
2010-12-01 00:19:00 +01:00
Rob Pike
fdeda13f9e fmt: fix documentation format glitch. no content to change.
Fixes #1313.

R=gri
CC=golang-dev
https://golang.org/cl/3361041
2010-11-30 14:28:33 -08:00
Adam Langley
3cb4bdb9ce utf8: make EncodeRune's destination the first argument.
R=r
CC=golang-dev
https://golang.org/cl/3364041
2010-11-30 16:59:43 -05:00
Adam Langley
287045085d crypto/elliptic: use a Jacobian transform
(Speeds up the code about 25x)

R=r
CC=golang-dev
https://golang.org/cl/3359042
2010-11-30 16:58:59 -05:00
Rob Pike
6540c85c7f fmt.Scan: accept Inf and NaN
Fixes #1308.

R=rsc, r2
CC=golang-dev
https://golang.org/cl/3280045
2010-11-30 12:59:52 -08:00
Rob Pike
448c05d7c8 strconv: Atof on Infs and NaNs
R=rsc
CC=golang-dev
https://golang.org/cl/3359041
2010-11-30 12:53:42 -08:00
Rob Pike
b389646243 sort: avoid overflow in pivot calculation.
thanks to snilsson@nada.kth.se for the original CL.

R=gri
CC=golang-dev, snilsson
https://golang.org/cl/3280044
2010-11-30 10:37:57 -08:00
Eoghan Sherry
0dc24603eb big: fix (*Rat) SetFrac64(a, b) when b < 0.
R=gri
CC=golang-dev
https://golang.org/cl/3352041
2010-11-30 10:23:27 -08:00
Luuk van Dijk
85cae877f5 runtime: parallel definitions in Go for all C structs.
R=rsc
CC=golang-dev
https://golang.org/cl/3308041
2010-11-30 18:21:26 +01:00
Peter Mundy
37b7e3db73 godoc: fix doc typo
Consistently use 6060 as the port number.

R=gri
CC=golang-dev
https://golang.org/cl/3287042
2010-11-29 14:31:24 -08:00
Luuk van Dijk
f08baa38f8 [68]l: correct dwarf location for globals and ranges for arrays.
R=rsc
CC=golang-dev
https://golang.org/cl/3306042
2010-11-29 19:25:33 +01:00
Rob Pike
d90d0ede3f fmt: allow "% X" as well as "% x"
R=rsc, cw, PeterGo
CC=golang-dev
https://golang.org/cl/3319042
2010-11-29 07:30:36 -08:00
Anschel Schaffer-Cohen
f5bc87cb75 exp/eval: build fix for parser.ParseFile API change.
R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/3283042
2010-11-29 09:25:31 +11:00
Mathieu Lonjaret
387d58e790 compress/flate: fix typo in comment.
R=golang-dev, nigeltao_gnome, nigeltao
CC=golang-dev
https://golang.org/cl/3334041
2010-11-26 13:05:22 +11:00
Alex Brainman
4e69976a60 runtime: fix SysFree to really free memory on Windows
Fixes #1294.

R=golang-dev, PeterGo, iant
CC=golang-dev
https://golang.org/cl/3271041
2010-11-24 11:47:35 +11:00
Wei Guangjing
95c341fc78 net: add ReadFrom and WriteTo windows version.
Fixes #1275.

R=rsc, brainman
CC=golang-dev
https://golang.org/cl/3136042
2010-11-22 11:01:30 -05:00
Anthony Martin
1ee4512b98 gc: better error message for bad type in channel send
# test program
1 package main
2
3 type C chan int
4
5 func F(c C) {
6 	c <- true
7 }

# old error
test.go:6: cannot use true (type bool) as type int in function argument

# new error
test.go:6: cannot use true (type bool) as type int in channel send

R=rsc, ejsherry
CC=golang-dev
https://golang.org/cl/3231042
2010-11-22 10:59:51 -05:00
Robert Griesemer
e21aac29ba position.go: more flexible AddFile method
This will make it easier to use Pos values
together with suffix arrays by slightly de-
coupling the mapping of Pos values to global
offsets.

R=rsc
CC=golang-dev
https://golang.org/cl/3231041
2010-11-20 21:30:36 -08:00
Ken Thompson
8cb8ba14a5 more on dynamic hash in compound literals.
thanks to vskrap, andrey mirtchovski,
and Eoghan Sherry.

R=rsc
CC=golang-dev
https://golang.org/cl/3245041
2010-11-20 15:58:28 -08:00
Robert Griesemer
b1fd0860df godoc: use correct time stamp to indicate accuracy of search result
- compare against fsModified to check if index is out of date
- don't change fsModified if there are no user-mapped file systems

R=rsc, iant
CC=golang-dev
https://golang.org/cl/3213041
2010-11-19 14:05:12 -08:00
Adam Langley
b84b20b820 crypto/cipher: add CFB and OCFB mode.
(Files which I left out of the initial commit to keep it small.)

R=rsc
CC=golang-dev
https://golang.org/cl/3183043
2010-11-19 16:17:58 -05:00
Russ Cox
b51f0c5cca index/suffixarray: use sort.Search
R=gri
CC=golang-dev
https://golang.org/cl/3200041
2010-11-19 16:04:25 -05:00
Adam Langley
07791d04d6 crypto/cipher: add package
cipher is intended to replace crypto/block over time. This
change only adds basic parts: CBC and CTR mode and doesn't add
the package to the top-level Makefile.

R=r, rsc
CC=golang-dev
https://golang.org/cl/3069041
2010-11-19 14:12:07 -05:00
Robert Griesemer
ad21c42f05 godoc: compute search index for all file systems under godoc's observation
R=rsc
CC=golang-dev
https://golang.org/cl/3209041
2010-11-18 19:55:38 -08:00
Ken Thompson
b3dd22fecb adjustable hash code in
typecheck of composit literals
to get rid of n^2 behavior.

R=rsc
CC=golang-dev
https://golang.org/cl/3208041
2010-11-18 13:07:34 -08:00
Ian Lance Taylor
1fab0cd12a Makefiles: Don't define _64BIT now that 6c does it by default.
R=rsc
CC=golang-dev
https://golang.org/cl/3207041
2010-11-18 12:34:47 -08:00
Ian Lance Taylor
553a88cfe7 cgo: Print required space after parameter name in wrapper function.
R=rsc, gri
CC=golang-dev
https://golang.org/cl/3206041
2010-11-18 12:34:04 -08:00
Ian Lance Taylor
d853b594b4 6c: automatically #define _64BIT.
This makes it much easier to use a tool like Swig which needs
to run either 8c or 6c on generated code which #include's
"runtime.h".

R=ken2, rsc
CC=golang-dev
https://golang.org/cl/3205041
2010-11-18 10:26:41 -08:00
Russ Cox
285298b975 sort: invert meaning of f in Search
Backwards incompatible change, but makes
it easier to reason about non-idiomatic searches:
now f specifies what is sought.

R=gri
CC=golang-dev
https://golang.org/cl/3195042
2010-11-18 11:46:07 -05:00
Russ Cox
19f0e4603d sort: edit doc comment for Search
Change comment to be more generic,
with indexed data structure search as
one common use case.

Fix typo []data.

R=gri, rog
CC=golang-dev
https://golang.org/cl/3159041
2010-11-18 07:16:09 -05:00
Andrew Gerrand
3fa6dcaca4 rpc: add RegisterName to allow override of default type name
R=r, r2
CC=golang-dev
https://golang.org/cl/2890041
2010-11-18 14:14:42 +11:00
Robert Griesemer
6aeaa5d3fe go/token position: code improvements per rsc's suggestion
R=rsc
CC=golang-dev
https://golang.org/cl/3183041
2010-11-17 17:00:25 -08:00
Robert Griesemer
ac966ac706 position.go: test cases for token.Pos
- adjustments to position.go due to changed sort.Search semantics
- various minor fixes

R=rsc
CC=golang-dev, r
https://golang.org/cl/3079041
2010-11-17 12:17:40 -08:00
Robert Griesemer
e38b7f4953 godoc: bug fix in relativePath
This fixes a problem with relativePath, where
a prefix was not recognized because it ended
in "//" as opposed to just "/".

Also: Minor unrelated cleanup of a declaration.

R=rsc
CC=golang-dev
https://golang.org/cl/3146041
2010-11-17 11:03:33 -08:00
Robert Griesemer
18ae633472 token/position: implemented Pos
A pos value represents a file-set specific, accurate
source position value. It is 8x smaller in size than
the corresponding Position value (4 bytes vs 32 bytes).

Using Pos values instead of Position values in AST
saves approx. 25MBytes of memory when running godoc
on the current repository.

This CL introduces the Pos, File, and FileSet data
types; it does not affect existing code. Another
(pending CL) will make the change to all dependent
source files.

Missing: tests

R=r
CC=golang-dev, rsc
https://golang.org/cl/2936041
2010-11-12 16:39:33 -08:00
Alex Brainman
a2a4e0c01a exec: enable tests on windows
Fixes #1104.

R=golang-dev, mattn, r
CC=Joe Poirier, golang-dev
https://golang.org/cl/3051041
2010-11-13 11:15:09 +11:00
Robert Griesemer
8f651ff742 sort.Search: slightly more precise wording in comment
(+ some cosmetic changes)

R=iant, iant2
CC=golang-dev
https://golang.org/cl/3076041
2010-11-12 16:08:56 -08:00
Roger Peppe
bac478da1c sort: simplify semantics of Search.
As discussed earlier.

R=gri
CC=golang-dev
https://golang.org/cl/3025042
2010-11-12 15:57:33 -08:00
Kyle Consalus
81cb189a06 Remove unnecessary casts in Get() methods.
Cleaner, but also results in a 25%+ performance improvement for Get()/SetValue() on my machine.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/3072041
2010-11-12 15:25:25 -08:00
Ken Thompson
48cc88d063 arm is not little-endian
R=rob
CC=golang-dev
https://golang.org/cl/3075041
2010-11-12 14:27:55 -08:00
Benny Siegert
8530e8ef65 strings: add LastIndexAny
The need for a LastIndexAny function has come up in the discussion
for https://golang.org/cl/3008041/. This function is
implemented analogously to lastIndexFunc, using functions from
the utf8 package.

R=r, rsc, PeterGo
CC=golang-dev
https://golang.org/cl/3057041
2010-11-12 12:47:50 -08:00
Rob Pike
f0d174b776 gc: fix arm build
R=ken2
CC=golang-dev
https://golang.org/cl/3074041
2010-11-12 12:46:46 -08:00
Adam Langley
fb784785f5 crypto/elliptic: add package
elliptic implements several standard elliptic curves over prime fields.

R=r, r2
CC=golang-dev
https://golang.org/cl/3065041
2010-11-12 14:55:32 -05:00
Ken Thompson
8613eb56b2 last of the arm conversions
R=rsc
CC=golang-dev
https://golang.org/cl/3053041
2010-11-11 19:54:35 -08:00
Robert Griesemer
6498c1d468 sort.Search: added extra test to verify efficiency
R=r
CC=golang-dev
https://golang.org/cl/3048041
2010-11-11 14:52:37 -08:00
Robert Griesemer
febde3882b sort.Search: more typos
R=r
CC=golang-dev
https://golang.org/cl/3042041
2010-11-11 13:52:49 -08:00
Adam Langley
ffa9000b75 crypto/x509: policy OID support and fixes.
* Add support for certificate policy identifiers
        * Fix the version number of generated certificates
        * Fix the parsing of version numbers
        * Fix the case of multiple name entries (it should have been a list of
          tagged values, not a tagged list of values).

R=r
CC=golang-dev
https://golang.org/cl/3044041
2010-11-11 15:50:40 -05:00
Robert Griesemer
86630fe6ad sort.Search: fix typo in documentation
R=r
CC=golang-dev
https://golang.org/cl/3016043
2010-11-11 10:51:59 -08:00
Alex Brainman
b611137098 runtime: free memory allocated by windows CommandLineToArgv
R=golang-dev, r2
CC=golang-dev
https://golang.org/cl/3003043
2010-11-11 10:38:45 +11:00
Ian Lance Taylor
e8605b1279 runtime: omit runtime· prefix from static functions (in ARM code).
R=r
CC=golang-dev
https://golang.org/cl/3026041
2010-11-10 15:23:20 -08:00
Ian Lance Taylor
7e69c90ade runtime: Add some missing runtime· prefixes to ARM asm code.
R=r, r2
CC=golang-dev
https://golang.org/cl/3024041
2010-11-10 15:10:19 -08:00
Ian Lance Taylor
be0b649eb1 path: Fix Glob when it finds a file in directory position.
When searching a list of directories, the files which match
the pattern are accumulated in a slice.  If the glob has a
wildcard for the directory, and the wildcard matches a file
rather than a directory, then the files found so far are
discarded.  E.g., path.Glob("*/x") in a directory which
contains both files and subdirectories.  This patch avoids
discarding matches found so far when a file is found.

R=r
CC=bsiegert, golang-dev
https://golang.org/cl/3015042
2010-11-10 13:25:49 -08:00
Robert Griesemer
194dde22c3 sort: binary search for sorted slices
R=r, r2
CC=golang-dev
https://golang.org/cl/2997041
2010-11-10 13:19:28 -08:00
Roger Peppe
089c21ea52 testing: delete redundant name argument to Benchmark().
[it was a carry over from the previous iteration]

R=r
CC=golang-dev
https://golang.org/cl/3016041
2010-11-10 09:39:26 -08:00
Ken Thompson
cb3754fd43 fix error converting result of complex
division. resolves issue 1261.

R=rsc
CC=golang-dev
https://golang.org/cl/2985043
2010-11-09 17:39:36 -08:00
Robert Griesemer
56bfe95e7f go/ast: change embedded token.Position fields to named fields
This is in preparation for a different position representation.
It also resolves situations where a node would be printed as
it's node position simply because the embedded token.Position
has a String method.

R=r
CC=golang-dev
https://golang.org/cl/2991041
2010-11-09 11:26:54 -08:00
Roger Peppe
e9afb9d399 container/list: make Remove return Value of removed element.
When it is known that there is already at least one element in the
list, it is awkwardly verbose to use three lines and an extra
variable declaration to remove the first or last item (a common
case), rather than use a simple expression.

a stack:
	stk.PushFront(x)
	x = stk.Front().Remove().(T)

vs.
	stk.PushFront(x)
	e := stk.Front()
	e.Remove()
	x = e.Value.(T)
[An alternative CL might be to add PopFront and PopBack methods].

R=gri
CC=golang-dev
https://golang.org/cl/3000041
2010-11-09 08:58:23 -08:00
Evan Shaw
49fdfe21dd bytes: SSE for bytes.IndexByte on amd64
Performance on 2.8 GHz Intel Core i7:

Before:
BenchmarkIndexByte4K  1000000              2997 ns/op        1366.70 MB/s
BenchmarkIndexByte4M      500           3049772 ns/op        1375.28 MB/s
BenchmarkIndexByte64M      50          49582280 ns/op        1353.48 MB/s

After:
BenchmarkIndexByte4K 10000000               298 ns/op       13744.97 MB/s
BenchmarkIndexByte4M    10000            285993 ns/op       14665.76 MB/s
BenchmarkIndexByte64M     500           4618172 ns/op       14531.48 MB/s

R=rsc, PeterGo, r2, r
CC=golang-dev
https://golang.org/cl/2888041
2010-11-08 17:33:53 -08:00
Rob Pike
e9c901dbf4 json: don't indirect before testing for custom unmarshaler
Fixes #1260.

R=gri
CC=golang-dev
https://golang.org/cl/2994041
2010-11-08 15:33:00 -08:00
Robert Griesemer
9f19392f1a os.Expand: don't call append for each non-variable char
R=r
CC=golang-dev
https://golang.org/cl/2993041
2010-11-08 15:13:35 -08:00
Rob Pike
02469b8200 strconv: quote erroneous string in errors
Fixes #1253.

R=gri
CC=golang-dev
https://golang.org/cl/2990041
2010-11-08 15:08:41 -08:00
Rob Pike
26cda27b0f os: add Expand function to evaluate environment variables.
Fixes #1258.

R=gri, msolo, bradfitzpatrick, r2
CC=golang-dev
https://golang.org/cl/2988041
2010-11-08 13:25:01 -08:00
Luuk van Dijk
fbd92dba96 6l/8l: generate dwarf variable names with disambiguating suffix.
R=rsc
CC=golang-dev
https://golang.org/cl/2733042
2010-11-08 19:48:21 +01:00
Wei Guangjing
11ace8e975 net: fix windows build
R=rsc
CC=golang-dev
https://golang.org/cl/2932041
2010-11-05 23:08:18 -04:00
Peter Mundy
3b44fbe869 testing: rename type Test to InternalTest
type Benchmark has been renamed to InternalBenchmark

R=rsc
CC=golang-dev
https://golang.org/cl/2942042
2010-11-05 23:05:53 -04:00
Russ Cox
9e1ee8ff4f env.bash: more quoting in case of spaces
R=r, r2
CC=golang-dev
https://golang.org/cl/2938041
2010-11-05 23:04:08 -04:00
Russ Cox
81cf9f7e63 libmach: detail for darwin errors
R=r, r2
CC=golang-dev
https://golang.org/cl/2937041
2010-11-05 23:03:53 -04:00
Peter Mundy
fa7341aafd syscall: use 64-bit file size for truncation on Linux
Truncate and Ftruncate for 32-bit Linux should use 64-bit
offset system calls.

R=rsc
CC=golang-dev, royger
https://golang.org/cl/2943041
2010-11-05 16:41:23 -04:00
Christopher Wedgwood
6101788972 io: use SetFinalizer more elegantly in Pipe
(this works now that issue 751 is resolved)

R=rsc
CC=golang-dev
https://golang.org/cl/2834041
2010-11-05 15:05:39 -04:00
Rob Pike
c9d39dca8d gob: don't add "." if package path is empty when registering a type.
R=rsc
CC=golang-dev
https://golang.org/cl/2939041
2010-11-05 11:22:28 -07:00
Eric Clark
40d10a34db gc: doc nit
R=rsc, r
CC=golang-dev
https://golang.org/cl/2918042
2010-11-05 11:21:54 -07:00
Keith Rarick
a144e3ec36 net: provide public access to file descriptors
Fixes #918.

R=rsc, rog, brainman
CC=golang-dev
https://golang.org/cl/2904041
2010-11-05 14:02:03 -04:00
Russ Cox
9ce0eb2d07 runtime: explain nacl closure failure
R=r, r2
CC=golang-dev
https://golang.org/cl/2889042
2010-11-05 14:00:46 -04:00
Evan Shaw
4d429c7fe5 6l: More SSE instruction fixes
PSADBW and PSHUFL had the wrong prefixes.

R=rsc
CC=golang-dev
https://golang.org/cl/2836041
2010-11-05 13:59:53 -04:00
Benny Siegert
a4f3d647d4 path: add Glob
As discussed in http://groups.google.com/group/golang-dev/browse_thread/thread/926b7d550d98ec9e,
add a simple "path expander" function, which returns all the
files matching the given pattern. This function is called Glob
after glob(3) in libc.

Also add a convenience function, hasMeta, that checks whether
a string contains one of the characters which are specially handled
by Match.

R=rsc, r, r2
CC=golang-dev
https://golang.org/cl/2476041
2010-11-05 10:47:56 -07:00
Rob Pike
9f7f69d300 gob: when sending an interface value, indirect down to the
underlying type; otherwise encoding fails when sending
a pointer value.

R=rsc
CC=golang-dev
https://golang.org/cl/2922041
2010-11-05 10:36:27 -07:00
Adam Langley
836529a63c crypto/tls: use pool building for certificate checking
Previously we checked the certificate chain from the leaf
upwards and expected to jump from the last cert in the chain to
a root certificate.

Although technically correct, there are a number of sites with
problems including out-of-order certs, superfluous certs and
missing certs.

The last of these requires AIA chasing, which is a lot of
complexity. However, we can address the more common cases by
using a pool building algorithm, as browsers do.

We build a pool of root certificates and a pool from the
server's chain. We then try to build a path to a root
certificate, using either of these pools.

This differs from the behaviour of, say, Firefox in that Firefox
will accumulate intermedite certificate in a persistent pool in
the hope that it can use them to fill in gaps in future chains.

We don't do that because it leads to confusing errors which only
occur based on the order to sites visited.

This change also enabled SNI for tls.Dial so that sites will return
the correct certificate chain.

R=rsc
CC=golang-dev
https://golang.org/cl/2916041
2010-11-05 09:54:56 -04:00
Alex Brainman
2b18b18263 runtime: fix windows build
R=rsc
CC=golang-dev
https://golang.org/cl/2923041
2010-11-05 17:27:12 +11:00
Graham Miller
23c41a1ef2 Small addition to previous optimization of memequal as discussed here: http://groups.google.com/group/golang-nuts/browse_thread/thread/f591ba36d83723c0/9aba02d344045f38
R=golang-dev, r, r2
CC=golang-dev
https://golang.org/cl/2880041
2010-11-04 13:45:18 -07:00
Robert Griesemer
3a50d721a8 go/scanner: line comments may end in EOF
R=rsc
CC=golang-dev
https://golang.org/cl/2908041
2010-11-04 13:15:42 -07:00
Russ Cox
132e5435e3 gc: line comments may end in EOF
R=ken2
CC=golang-dev
https://golang.org/cl/2907041
2010-11-04 16:04:04 -04:00