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

1913 Commits

Author SHA1 Message Date
Rob Pike
7ee6d44e4f fmt.Scan: custom formatters
R=rsc
CC=golang-dev
https://golang.org/cl/1315042
2010-05-26 18:16:41 -07:00
Rob Pike
6965b407dd fmt.Scan: custom formatters
R=rsc
CC=golang-dev
https://golang.org/cl/1315042
2010-05-26 18:15:09 -07:00
Robert Griesemer
a4129988a4 godoc: collect package comments from all package files, not just the first one found
R=r
CC=golang-dev
https://golang.org/cl/1331041
2010-05-26 13:44:27 -07:00
Adam Langley
f199f292e7 big: add ModInverse.
ModInverse is just a small wrapper around GcdInt, but it's nice to
have in order to be clear about what one is doing in other code.

R=gri, agl1
CC=golang-dev
https://golang.org/cl/1244045
2010-05-26 15:58:58 -04:00
Rob Pike
5b77928478 fmt: fix 386 build. error strings differ for overflow on 386.
R=gri
CC=golang-dev
https://golang.org/cl/1316042
2010-05-26 10:01:52 -07:00
Rob Pike
71f130f55c fmt.Scan, fmt.Scanln: Start of a simple scanning API in the fmt package.
Still to do:
	- composite types
	- user-defined scanners
	- format-driven scanning
The package comment will be updated when more of the functionality is in place.

R=rsc
CC=golang-dev
https://golang.org/cl/1252045
2010-05-25 21:02:35 -07:00
Nigel Tao
0c662f60a5 Optimize exp/draw/x11 flusher inner loop.
On my laptop, time to prepare and write 800x600 pixels over the
socket falls from 125-ish ms to 80-ish ms.

Thanks to Roger Peppe for the suggestion.

R=r
CC=golang-dev
https://golang.org/cl/1228044
2010-05-24 19:32:42 -07:00
Russ Cox
566f598046 fix build - nacl stubs
TBR=nigeltao
CC=golang-dev
https://golang.org/cl/1259042
2010-05-24 17:00:21 -07:00
Christopher Wedgwood
5c19c4e5e3 net: udp, implement BindToDevice
R=rsc
CC=golang-dev, r
https://golang.org/cl/1271041
2010-05-24 16:53:23 -07:00
Evan Shaw
751fc425ee big: Rat test improvements
R=gri
CC=golang-dev
https://golang.org/cl/1270041
2010-05-24 16:38:41 -07:00
Nigel Tao
c95e11db56 Fix typo in exp/draw/x11.
R=rsc
CC=golang-dev
https://golang.org/cl/1282041
2010-05-24 15:07:47 -07:00
Russ Cox
21518ea2af runtime: free old hashmap pieces during resizing
R=r
CC=golang-dev
https://golang.org/cl/1254044
2010-05-24 14:31:10 -07:00
Alex Brainman
2a1ee42e2b fix windows build
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/1209048
2010-05-24 11:48:14 -07:00
Nigel Tao
2d8aee45b8 Make draw/x11 treat $DISPLAY the same way x-go-bindings does.
This ought to make draw/x11 work on a Mac.

R=rsc
CC=golang-dev
https://golang.org/cl/1265042
2010-05-24 11:44:09 -07:00
Adam Langley
eadebba36f big: prevent errors in Exp in the face of aliasing
R=gri
CC=golang-dev, golang-dev
https://golang.org/cl/1244044
2010-05-24 14:32:55 -04:00
Andrew Gerrand
977475fd49 syscall: update freebsd_amd64
R=rsc, r
CC=golang-dev
https://golang.org/cl/1268041
2010-05-24 09:58:59 -07:00
Nigel Tao
e974fb949e When making images, allocate one big buffer instead of many small ones.
R=rsc, r
CC=golang-dev
https://golang.org/cl/1267041
2010-05-23 11:12:00 -07:00
Robert Griesemer
72fd5c80f8 go/printer, gofmt: fix printing of labels,
apply gofmt to src, misc

Fixes #752.

R=rsc
CC=golang-dev
https://golang.org/cl/1240044
2010-05-21 20:25:08 -07:00
Robert Griesemer
38b2d10bb2 test/hilbert.go: convert to test case and benchmark for big.Rat
R=rsc
CC=golang-dev
https://golang.org/cl/1231044
2010-05-21 20:20:17 -07:00
Christopher Wedgwood
13d5a19a98 net: implement raw sockets
R=rsc
CC=golang-dev
https://golang.org/cl/684041
2010-05-21 17:30:40 -07:00
Evan Shaw
5ac88f4a8b big: Add Rat type
Implementations are pretty rough and simple at this point, but it's a start.

R=gri
CC=golang-dev
https://golang.org/cl/1250043
2010-05-21 16:14:55 -07:00
Russ Cox
f58ba18a08 runtime: correct tracebacks for nascent goroutines, even closures
Fixes #780.

R=r
CC=golang-dev
https://golang.org/cl/1221042
2010-05-21 14:40:21 -07:00
Russ Cox
48673d2745 syscall: add Utimes, Futimes stubs for NaCl - fix build
TBR=nigeltao
CC=golang-dev
https://golang.org/cl/1262042
2010-05-21 14:39:10 -07:00
Russ Cox
1d076a6e61 syscall: regenerate zsyscall_linux_arm.go - fix build
R=kaib
CC=golang-dev
https://golang.org/cl/1209047
2010-05-21 14:33:17 -07:00
Robert Griesemer
e8dec0dc05 big: fix Int.SetString comment, simplify implementation,
always return z for nat.scan

R=rsc
CC=golang-dev
https://golang.org/cl/1236043
2010-05-21 14:28:34 -07:00
Robert Griesemer
638ef0794f bignum: deprecate by moving into exp directory
R=rsc
CC=golang-dev
https://golang.org/cl/1211047
2010-05-21 14:14:22 -07:00
Robert Griesemer
e3bfeec474 big: implemented Int.Binomial (to be used in test/hilbert.go with the
forthcoming implementation of big.Rat)

R=rsc
CC=golang-dev
https://golang.org/cl/1229047
2010-05-20 23:10:51 -07:00
Michael Hoisie
9192ec2ea1 netFD: fix race between Close and Read/Write
Fixes #783.

R=rsc, cw
CC=golang-dev
https://golang.org/cl/1207043
2010-05-20 17:13:50 -07:00
Roger Peppe
798140693e Fix Rectangle.Canon()
R=rsc, r, gri
CC=golang-dev
https://golang.org/cl/1239043
2010-05-20 14:33:50 -07:00
Nigel Tao
efda3aba10 Fast-ish path for drawing onto an image.RGBA destination.
Time to draw.Draw a 200x200 image fell from 18.4ms (and 1 malloc) to
5.6ms (and 0 mallocs). It's still relatively slow since it assumes
nothing about the src or mask images, but it does remove the malloc.
There are existing faster, more specialized paths for copies, fills
and image glyph masks.

Also added a "compare to a slow but obviously correct implementation"
check to draw_test.go.

R=rsc, r
CC=golang-dev
https://golang.org/cl/1223044
2010-05-20 13:57:18 -07:00
Christopher Wedgwood
37a6adf1d3 syscall: linux, implement BindToDevice
R=rsc
CC=adg, golang-dev, r
https://golang.org/cl/1253043
2010-05-20 09:43:13 -07:00
Christopher Wedgwood
5265857ac4 syscall: bsd, stub BindToDevice
R=rsc
CC=adg, golang-dev, r
https://golang.org/cl/1257041
2010-05-20 09:39:35 -07:00
Russ Cox
4843b130bb runtime: avoid allocation for fixed strings
R=r
CC=golang-dev
https://golang.org/cl/1083041
2010-05-19 21:33:31 -07:00
Brad Fitzpatrick
1afa2a1b2d os: add Chtimes function
R=rsc, r
CC=golang-dev
https://golang.org/cl/1103041
2010-05-19 17:48:53 -07:00
Russ Cox
cbc01a3e76 syscall: add Utimes on Darwin/FreeBSD, add Futimes everywhere
Needed for CL 1103041 and beyond.

R=adg, bradfitzpatrick
CC=bradfitz, golang-dev
https://golang.org/cl/1172042
2010-05-19 17:47:57 -07:00
Russ Cox
b198c8612e runtime: allow large map values
Fixes #772.

R=ken2
CC=golang-dev
https://golang.org/cl/1206043
2010-05-19 12:57:47 -07:00
Robert Griesemer
a688eb6ee4 big: potential bug fix, cleanups
- implemented setWord, use it where setUint64 is wrong
- divLarge: use fast mulWW, divWW; implemented mulWW, divWW
- better assembly code for addMulVVW

R=rsc
CC=golang-dev
https://golang.org/cl/1258042
2010-05-19 09:36:50 -07:00
Russ Cox
b629687f79 fix build - no netchan tests under NaCl
TBR=r
CC=golang-dev
https://golang.org/cl/1230042
2010-05-18 23:25:07 -07:00
Michael Hoisie
4a3cb1ad2f bytes: add Trim, TrimLeft, TrimRight, and generic functions
R=rsc, r
CC=golang-dev
https://golang.org/cl/946045
2010-05-18 23:01:05 -07:00
Charles L. Dorian
809479740f math: amd64 versions of fdim, fmax, fmin
Uses the SSE2 max, min instructions. Also shorter sqrt_amd64.s

R=rsc
CC=golang-dev
https://golang.org/cl/1216042
2010-05-18 22:33:50 -07:00
Charles L. Dorian
879241d819 math: signed zero Sqrt special case
IEEE 754 says: sqrt(-0) = -0

R=rsc
CC=golang-dev
https://golang.org/cl/1098041
2010-05-18 22:16:01 -07:00
Robert Griesemer
90d0c3316c big: bug fix for division
Fixes #784.

R=rsc
CC=golang-dev
https://golang.org/cl/1196043
2010-05-18 16:31:49 -07:00
Kyle Consalus
2db47c9083 Trivial optimization.
Cached string indexing in inner loop of Btoui64.

    Before:
    strconv_test.BenchmarkAtoi   5000000           309 ns/op
    strconv_test.BenchmarkAtoiNeg    5000000           325 ns/op
    strconv_test.BenchmarkAtoi64     5000000           465 ns/op
    strconv_test.BenchmarkAtoi64Neg  5000000           469 ns/op

    After:
    strconv_test.BenchmarkAtoi  10000000           182 ns/op
    strconv_test.BenchmarkAtoiNeg   10000000           193 ns/op
    strconv_test.BenchmarkAtoi64    10000000           251 ns/op
    strconv_test.BenchmarkAtoi64Neg 10000000           258 ns/op

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/1227042
2010-05-18 16:29:24 -07:00
Robert Griesemer
dbb6232724 big: implemented format support for fmt library, MulRange
- support for binary prefix 0b (to match fmt.Format)
- renamed nat.new -> nat.setUint64 for consistency
- more tests

R=r
CC=golang-dev
https://golang.org/cl/1233041
2010-05-15 10:23:41 -07:00
Charles L. Dorian
1d4e2d1adc cmath: add package description
Also update range of Phase and Polar due to signed zero.
[Phase(cmplx(-1, +0)) = pi and Phase(cmplx(-1, -0)) = -pi]

R=rsc, r
CC=golang-dev
https://golang.org/cl/1235041
2010-05-15 10:06:54 -07:00
Robert Griesemer
650cc32739 go/printer (gofmt): don't lose mandatory semicolons
Fixes #779.

R=r
CC=golang-dev
https://golang.org/cl/1218042
2010-05-14 15:38:25 -07:00
Roger Peppe
14e04f4d40 Prevent Printf crashing when giving an extra nil argument.
R=rsc, r
CC=golang-dev
https://golang.org/cl/1195041
2010-05-13 12:49:48 -07:00
Robert Griesemer
d6acc0646b http: prevent crash if remote server is not responding with "HTTP/"
Fixes #775.

R=rsc
CC=golang-dev
https://golang.org/cl/1180042
2010-05-11 16:50:20 -07:00
Russ Cox
75dbbd2137 netchan: be less chatty during gotest
R=r
CC=golang-dev
https://golang.org/cl/1186041
2010-05-11 14:57:08 -07:00
Russ Cox
4e5bc6a8fe json: fix array -> non-array decoding
Fixes #773.

R=adg
CC=golang-dev
https://golang.org/cl/1120042
2010-05-11 14:38:55 -07:00
Nigel Tao
916426ea76 drawGlyphOver optimization.
Timings (as for change 1122043) go from 49ms to 48ms ish. It's
mostly lost in the noise, but it probably doesn't hurt.

R=r
CC=golang-dev
https://golang.org/cl/1179041
2010-05-11 13:35:16 +10:00
Nigel Tao
d7a6d22852 exp/draw fast path for glyph images.
To draw.Draw a 32x32 image.Alpha 10000 times,
Before: 633ms with 10000 mallocs
After: 49ms with 0 mallocs

These times are just blitting an image.Alpha, and do not include
rasterizing a glyph's vector contours to an image.Alpha.

The "generic" test case in draw_test.go tests this fast path.

R=rsc
CC=golang-dev
https://golang.org/cl/1122043
2010-05-10 10:32:08 +10:00
Rob Pike
b717768b94 template: regularize the handling of interfaces, pointers, and
methods when looking up names.
Fixes #764.

R=rsc
CC=golang-dev
https://golang.org/cl/1170041
2010-05-09 16:40:38 -07:00
Michael Hoisie
834abb8068 json: accept escaped slash in string scanner
R=rsc
CC=golang-dev
https://golang.org/cl/1173041
2010-05-08 17:34:05 -07:00
Robert Griesemer
52cc058172 big: cleanups and performance tuning
- removed last argument (n) from all core arithmetic routines;
  instead, use the length of the result

- simplified nat.make implementation and chose a better capacity
  for new values, removed a TODO in the process

Changing the constant e from 1 (old) to 4 (new) improved
pidigits -s -n 10000 by ~9% (on a 3.06GHz Intel Core 2 Duo):

user	0m3.882s (old)
user	0m3.549s (new)

R=rsc
CC=golang-dev
https://golang.org/cl/1133043
2010-05-08 13:52:36 -07:00
Robert Griesemer
61eb0e71f2 big: more cleanup
- pass []Word instead of *Word to core arithmetic functions
- remove dead code

R=rsc
CC=golang-dev
https://golang.org/cl/1154042
2010-05-07 18:26:31 -07:00
Rob Pike
f023e859cf compress: renamings.
NewDeflater -> NewWriter
NewInflater -> NewReader
Deflater -> Compressor
Inflater -> Decompressor

R=rsc
CC=golang-dev
https://golang.org/cl/1166041
2010-05-07 14:32:34 -07:00
Rob Pike
b541921b66 gob: bug fix: errors encoding the payload were not
returned to caller.

R=rsc
CC=golang-dev
https://golang.org/cl/1164041
2010-05-07 13:30:13 -07:00
Rob Pike
56c5710b38 gob: add an internal commentary example showing how the
values are encoded for transmission.

R=rsc
CC=golang-dev
https://golang.org/cl/1146041
2010-05-07 11:44:41 -07:00
Ian Lance Taylor
e1b47159ab Save the scheduling state even predawn.
This permits cgo callbacks to work when run in init code.
Otherwise cgocallback switches to the wrong stack address.

R=rsc
CC=golang-dev
https://golang.org/cl/1123043
2010-05-06 22:07:03 -07:00
Robert Griesemer
6d7583d5fd fix build (typo in arith_386.s)
R=rsc
CC=golang-dev
https://golang.org/cl/1139042
2010-05-06 19:16:26 -07:00
Robert Griesemer
3f287b5002 big: implemented overlap-tolerant shifts in assembly
- no need to make copies in cases of aliases
- removed deprecated internal shift functions
- minor unrelated simplifications

This change improves pidigits -s -n10000 by almost 20%:

user 0m6.156s (old)
user 0m4.999s (new)

(pidigits -s -n20000 goes from ~25s to ~19s)

R=rsc
CC=golang-dev
https://golang.org/cl/1149041
2010-05-06 18:20:01 -07:00
Rob Pike
eb48bfbbda runtime.GOMAXPROCS: hack it to have it return the old value.
R=rsc
CC=golang-dev
https://golang.org/cl/1140041
2010-05-06 11:50:47 -07:00
Rob Pike
9088f9f245 gob: add test for indirect maps, slices, arrays.
fix a bug in the handling of indirect maps.

R=rsc
CC=golang-dev
https://golang.org/cl/1132042
2010-05-06 10:45:18 -07:00
Nigel Tao
20ba090978 Make exp/draw/x11 respect $XAUTHORITY.
R=rsc, cw, nigeltao_golang
CC=golang-dev
https://golang.org/cl/1134041
2010-05-06 18:41:42 +10:00
Rob Pike
7861da737e gob: add support for maps.
Because maps are mostly a hidden type, they must be
implemented using reflection values and will not be as
efficient as arrays and slices.

R=rsc
CC=golang-dev
https://golang.org/cl/1127041
2010-05-05 16:46:39 -07:00
Rob Pike
46152bb9fe pkg/Makefile: add netchan to standard package list
R=golang-dev
CC=golang-dev
https://golang.org/cl/1121041
2010-05-05 15:17:26 -07:00
Kyle Consalus
24bfd652ee Conversion from loop to copy().
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/1072041
2010-05-05 09:57:53 -07:00
Conrad Meyer
5789c86fc0 Fix a typo in net/unixsock
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/1113041
2010-05-05 09:55:11 -07:00
Robert Griesemer
b9caa4ac56 big: completed set of Int division routines & cleanups
- renamed Len -> BitLen, simplified implementation
- renamed old Div, Mod, DivMod -> Que, Rem, QuoRem
- implemented Div, Mod, DivMod (Euclidian definition, more
  useful in a mathematical context)
- fixed a bug in Exp (-0 was possible)
- added extra tests to check normalized results everywhere
- uniformly set Int.neg flag at the end of computations
- minor cosmetic cleanups
- ran all tests

R=rsc
CC=golang-dev
https://golang.org/cl/1091041
2010-05-03 18:48:05 -07:00
Russ Cox
7d7ebd2fe1 runtime, strconv: tiny cleanups
R=r
CC=golang-dev
https://golang.org/cl/1081042
2010-05-03 17:47:40 -07:00
Russ Cox
9995dec9da big: fix memory corruption in nat.shr
R=gri
CC=golang-dev
https://golang.org/cl/1084041
2010-05-03 14:28:45 -07:00
Russ Cox
23c0aa3916 runtime/arm: fix build
Import _mulv from Inferno again, change R9 to R2.
Not sure what the other differences were for, but
they weren't working.

TBR=kaib
CC=golang-dev
https://golang.org/cl/1079041
2010-05-03 13:24:39 -07:00
Evan Shaw
4d1b1574af big: Add bitwise methods for Int
R=gri
CC=golang-dev
https://golang.org/cl/987041
2010-05-03 11:20:52 -07:00
Russ Cox
23bf408d41 syscall: fix arm build (fix bugs in generator, to add O_LARGEFILE)
R=r
CC=golang-dev
https://golang.org/cl/1021043
2010-05-03 11:11:01 -07:00
Rob Pike
e1d20d0a51 bytes: Change IndexAny to look for UTF-8 encoded characters.
Also improve the implementations of Equals and Compare.

R=rsc
CC=golang-dev
https://golang.org/cl/969047
2010-05-03 10:59:00 -07:00
Giles Lean
3c32300c4d runtime: update godefs usage comment for GOARCH=386 GOOS={darwin,freebsd}
When trying to regenerate src/pkg/runtime/darwin/386/defs.h
on a 64 bit capable Snow Leopard (OS X 10.6.3) system I
needed to add -f -m32 to godefs, as this OS and hardware
combination defaults to 64 bit compilation.

For safety, make the same change to the 32 bit FreeBSD
instructions in .../freebsd/defs.c.  (Tested OK and no
problems introduced.)

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/1052042
2010-05-03 01:26:39 -07:00
Charles L. Dorian
37089cce67 math: fix typo in Cbrt description
R=rsc
CC=golang-dev
https://golang.org/cl/979043
2010-05-02 23:33:08 -07:00
Robert Griesemer
26078c395a big: cleanup and removal of redundant functionality
R=rsc
CC=golang-dev
https://golang.org/cl/1048041
2010-05-01 15:11:27 -07:00
Russ Cox
6361f52fc4 gc: be pickier about slice, chan, array, and map sizes
Fixes #589.

R=ken2
CC=golang-dev
https://golang.org/cl/1032044
2010-05-01 13:15:42 -07:00
Russ Cox
cf0e224380 vector: use correct capacity in call to make
R=gri, r, bflm
CC=golang-dev
https://golang.org/cl/1032043
2010-05-01 13:00:01 -07:00
Robert Griesemer
58e77990ba big: use fast shift routines
- fixed a couple of bugs in the process
  (shift right was incorrect for negative numbers)
- added more tests and made some tests more robust
- changed pidigits back to using shifts to multiply
  by 2 instead of add

  This improves pidigit -s -n 10000 by approx. 5%:

  user 0m6.496s (old)
  user 0m6.156s (new)

R=rsc
CC=golang-dev
https://golang.org/cl/963044
2010-04-30 21:25:48 -07:00
Robert Griesemer
161b44c76a big/arith: assembly routines for 386 long shifts (2nd round)
R=rsc
CC=golang-dev
https://golang.org/cl/986044
2010-04-30 14:41:04 -07:00
Alex Brainman
b94ae26073 syscall: handle EOF on pipe - special case on Windows
R=rsc
CC=golang-dev
https://golang.org/cl/962046
2010-04-30 12:46:46 -07:00
Robert Griesemer
ac1d46a22a fix build
R=rsc
CC=golang-dev
https://golang.org/cl/1044041
2010-04-30 12:01:15 -07:00
Robert Griesemer
407dbb42d4 big: improved computation of "karatsuba length" for faster multiplies
This results in an improvement of > 35% for the existing Mul benchmark
using the same karatsuba threshold, and an improvement of > 50% with
a slightly higher threshold (32 instead of 30):

big.BenchmarkMul           500	   6731846 ns/op (old alg.)
big.BenchmarkMul	   500	   4351122 ns/op (new alg.)
big.BenchmarkMul           500	   3133782 ns/op (new alg., new theshold)

Also:
- tweaked calibrate.go, use same benchmark as for Mul benchmark

R=rsc
CC=golang-dev
https://golang.org/cl/1037041
2010-04-30 11:54:27 -07:00
Robert Griesemer
f78b09e673 big: assembly routines for 386 long shifts
R=rsc
CC=golang-dev
https://golang.org/cl/974043
2010-04-30 11:53:37 -07:00
Robert Griesemer
2b0a30c4b5 big: implemented core shift routines in arith.go and
provide assembly versions (for x86-64 for now)

(Not yet used - waiting for previous CL to clear)

R=rsc
CC=golang-dev
https://golang.org/cl/1040041
2010-04-30 09:29:11 -07:00
Nigel Tao
05cf357dd9 Add EWOULDBLOCK to sycall_nacl.go.
R=rsc
CC=go-dev, golang-dev
https://golang.org/cl/1006045
2010-04-30 18:45:04 +10:00
Alex Brainman
f81d471940 rename GOOS=mingw to GOOS=windows
R=rsc, Joe Poirier
CC=golang-dev
https://golang.org/cl/1015043
2010-04-29 23:45:14 -07:00
Russ Cox
7906e31167 syscall: force O_LARGEFILE in Linux open system call
Fixes #717.

R=adg, PeterGo
CC=golang-dev
https://golang.org/cl/1032041
2010-04-29 23:34:06 -07:00
Joe Poirier
4aaddf8a35 syscall: mingw Sleep
R=rsc, brainman
CC=golang-dev
https://golang.org/cl/961047
2010-04-29 23:08:22 -07:00
Christopher Wedgwood
b5da6ea4dd net: use short variable declaration
R=rsc
CC=golang-dev
https://golang.org/cl/1019043
2010-04-29 11:02:10 -07:00
Christopher Wedgwood
be9f6344a7 net: parser should handle EOF without newline properly.
Fixes #686.

R=rsc
CC=adg, golang-dev
https://golang.org/cl/979044
2010-04-29 11:01:21 -07:00
Russ Cox
718da3339a darwin: bsdthread_create can fail; print good error
Fixes #549.

R=adg
CC=golang-dev
https://golang.org/cl/1019042
2010-04-28 19:36:42 -07:00
Russ Cox
7c77e450cc net: do not require newline at end of resolv.conf
Fixes #686.

R=adg
CC=golang-dev
https://golang.org/cl/961046
2010-04-28 19:36:04 -07:00
Russ Cox
0485ba72c3 xml: allow text segments to end at EOF
Fixes #674.

R=adg
CC=golang-dev
https://golang.org/cl/1018042
2010-04-28 19:29:20 -07:00
Christopher Wedgwood
1331f8b3cb fmt: %T print <nil> for nil
R=r
CC=golang-dev, rsc
https://golang.org/cl/1014043
2010-04-28 13:07:19 -07:00
Ian Lance Taylor
96179629ef Remove destination of symlink test in case it got left behind
earlier.

R=rsc
CC=golang-dev
https://golang.org/cl/972045
2010-04-28 11:08:07 -07:00
Russ Cox
000ab98df6 5l, 6l, 8l, runtime: make -s binaries work
5l, 6l, 8l: change ELF header so that strip doesn't destroy binary

Fixes #261.

R=iant, r
CC=golang-dev
https://golang.org/cl/994044
2010-04-27 22:40:26 -07:00
Robert Griesemer
b2183701c0 big: implemented Karatsuba multiplication
Plus:
- calibration "test" - include in tests with gotest -calibrate
- basic Mul benchmark
- extra multiplication tests
- various cleanups

This change improves multiplication speed of numbers >= 30 words
in length (current threshold; found empirically with calibrate):

The multiplication benchmark (multiplication of a variety of long numbers)
improves by ~35%, individual multiplies can be significantly faster.

gotest -benchmarks=Mul
big.BenchmarkMul	     500	   6829290 ns/op (w/ Karatsuba)
big.BenchmarkMul	     100	  10600760 ns/op

There's no impact on pidigits for -n=10000 or -n=20000
because the operands are are too small.

R=rsc
CC=golang-dev
https://golang.org/cl/1004042
2010-04-27 19:16:08 -07:00
Russ Cox
dc606a20ce net: drop non-RHEL-4.6 ports from test
Fixes #610.

R=adg
CC=golang-dev
https://golang.org/cl/1006044
2010-04-27 19:04:22 -07:00
Russ Cox
01fc062496 iterable: expose iterFunc as iterable.Func
Fixes #483.

R=dsymonds, dsymonds1
CC=golang-dev
https://golang.org/cl/965044
2010-04-27 18:48:29 -07:00
Russ Cox
9c8cee712d net: fix bug in internetSocket introduced by error cleanup.
Fixes #750.

R=adg
CC=golang-dev
https://golang.org/cl/988043
2010-04-27 18:48:11 -07:00
Andrew Gerrand
8553b9c68f template: remove reference to json-template
Rather than confuse people by linking to a spec we
don't fully support, let them just use the package docs.

R=r, rsc
CC=golang-dev
https://golang.org/cl/1016041
2010-04-28 10:14:58 +10:00
Robert Griesemer
e42ebea96c fix build
R=r
CC=golang-dev
https://golang.org/cl/989044
2010-04-27 14:05:53 -07:00
Russ Cox
646301a766 rpc/jsonrpc: support for jsonrpc wire encoding
R=r
CC=golang-dev
https://golang.org/cl/989042
2010-04-27 13:51:58 -07:00
Russ Cox
dc644b8f43 json: delete obsolete code
R=r
CC=golang-dev
https://golang.org/cl/943047
2010-04-27 13:51:38 -07:00
Russ Cox
dcff89057b rpc: abstract client and server encodings
R=r
CC=golang-dev, rog
https://golang.org/cl/811046
2010-04-27 13:51:25 -07:00
Robert Griesemer
72f9b2ebee gofmt: fine-tune stripping of parentheses
(composite literals in control clauses only need
       parentheses if the literals start with a type name)

R=rsc
CC=golang-dev
https://golang.org/cl/962045
2010-04-27 13:27:48 -07:00
Robert Griesemer
48ccf8247e go/parser: don't require parens around composite literals inside a composite literal
within an if, for, or switch control clause

R=rsc
CC=golang-dev
https://golang.org/cl/943046
2010-04-27 11:57:17 -07:00
Robert Griesemer
2bfc2d7772 gofmt: don't strip mandatory ()'s around composite literals in control clauses
Fixes #748.

R=rsc
CC=golang-dev
https://golang.org/cl/946043
2010-04-27 10:59:33 -07:00
Russ Cox
0e8384af65 json: streaming
R=r, cw
CC=golang-dev
https://golang.org/cl/952041
2010-04-27 10:46:37 -07:00
Russ Cox
bec40ba516 json: preserve field name case by default
This matches the old JSON package behavior.
All lowercase names are not as standard as I believed,
and it seems less surprising to need to write

	type T struct { Field string "field" }

to get lower case (behavior after this CL) than it does to need
to write

	type T struct { Field string "Field" }

to preserve the case (behavior before this CL).

Also test and  fix unmarshal into non-nil interface
value or pointer.

Fixes #744.

R=r
CC=golang-dev
https://golang.org/cl/1013041
2010-04-27 10:24:00 -07:00
Russ Cox
cc62bed075 pipe: implementation #3; this time for sure!
Added goroutine; got simpler.

Fixes deadlock when doing Read+Close
or Write+Close on same end.

R=r, cw
CC=golang-dev
https://golang.org/cl/994043
2010-04-27 10:17:17 -07:00
Micah Stetson
6c124cb879 time: remove incorrect time.ISO8601 and add time.RFC3339
Fixes #734.

R=rsc, r
CC=golang-dev
https://golang.org/cl/975042
2010-04-27 00:05:24 -07:00
Alex Brainman
a83c5f5cad syscall: fix mingw build
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/988042
2010-04-26 23:47:53 -07:00
Alex Brainman
fb6b39186b os, syscall: more mingw
R=rsc, rsc1
CC=golang-dev
https://golang.org/cl/878046
2010-04-26 23:17:14 -07:00
Giles Lean
461314b6e7 os: create sys_bsd.go
R=rsc
CC=golang-dev
https://golang.org/cl/897042
2010-04-26 23:01:31 -07:00
Evan Shaw
bf1c881afe os: Fix build for MinGW
R=rsc
CC=golang-dev
https://golang.org/cl/1014041
2010-04-26 22:50:47 -07:00
Charles L. Dorian
22f84c5b2a math: more special cases for signed zero
R=rsc
CC=golang-dev
https://golang.org/cl/937042
2010-04-26 22:44:39 -07:00
Russ Cox
72d9322032 crypto/tls: simpler implementation of record layer
Depends on CL 957045, 980043, 1004043.
Fixes #715.

R=agl1, agl
CC=golang-dev
https://golang.org/cl/943043
2010-04-26 22:19:04 -07:00
Russ Cox
47a0533411 net: introduce net.Error interface
Adds two more methods, Timeout and Temporary.
Implemented by os.Errno too.  The intent is to make
the checks for os.EAGAIN a little less clunky.
It should also let us clean up a bug that Mike Solomon
pointed out: if a network server gets an "out of file descriptors"
error from Accept, the listener should not stop.
It will be able to check this because that error would
have Temporary() == true.

Also clean up some underscore names.

Fixes #442.

R=r
CC=golang-dev, msolo
https://golang.org/cl/957045
2010-04-26 22:15:25 -07:00
Russ Cox
1d18e89125 net: add Pipe
R=r
CC=golang-dev
https://golang.org/cl/1004043
2010-04-26 10:36:05 -07:00
Russ Cox
78551a9b43 bytes: add Next method to Buffer, simplify Read.
R=r
CC=golang-dev
https://golang.org/cl/980043
2010-04-26 10:02:01 -07:00
Russ Cox
9f69ab39f0 xml: fix innerxml handling of & escapes
R=r
CC=golang-dev
https://golang.org/cl/1009041
2010-04-26 10:01:33 -07:00
Russ Cox
13bb28a40a template: fix handling of pointer inside interface
R=r
CC=golang-dev
https://golang.org/cl/982043
2010-04-26 10:01:13 -07:00
Russ Cox
6f33f34bbc regexp: allow escaping of any punctuation
More in line with other regexp packages
and egrep; accommodates overzealous escapers.

R=r
CC=golang-dev
https://golang.org/cl/1008041
2010-04-26 10:00:18 -07:00
Russ Cox
c6138efbcb runtime: closures, defer bug fix for Native Client
Enable package tests for Native Client build.

R=r
CC=golang-dev
https://golang.org/cl/957042
2010-04-22 17:52:22 -07:00
Rob Pike
6e80a01ab7 os/stat_freebsd.go: maybe fix build for freebsd
R=rsc
CC=golang-dev
https://golang.org/cl/970042
2010-04-22 17:04:28 -07:00
Evan Shaw
841a32dd5e big: Create type nat
Changed most of the functions in nat.go to methods on nat.

R=gri
CC=golang-dev
https://golang.org/cl/976041
2010-04-22 16:57:29 -07:00
Rob Pike
5cd8c83037 FileInfo: regularize the types of some fields.
Uid, Gid become int.
File size info becomes int64.
Times become int64.

R=rsc, cw
CC=golang-dev
https://golang.org/cl/968042
2010-04-22 14:01:33 -07:00
Evan Shaw
f0ecf34f29 vector: Don't always regenerate {int,string}vector.go
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/917042
2010-04-23 00:43:59 +10:00
Evan Shaw
455e799f6d big: Add some tests
R=rsc, gri
CC=golang-dev
https://golang.org/cl/967041
2010-04-21 17:12:36 -07:00
Russ Cox
dba9d62bc2 json: Marshal, Unmarshal using new scanner
R=r
CC=golang-dev
https://golang.org/cl/953041
2010-04-21 16:40:53 -07:00
Russ Cox
214a55b06a runtime: switch state back to Grunning after recovery
Fixes #733.

R=r
CC=golang-dev
https://golang.org/cl/958041
2010-04-21 16:27:41 -07:00
Russ Cox
e7b6fe3989 xml: new "innerxml" tag to collect inner XML
R=r
CC=golang-dev
https://golang.org/cl/971041
2010-04-21 16:27:31 -07:00
Russ Cox
57d9de3ac8 utf16: add DecodeRune, EncodeRune
R=r
CC=golang-dev
https://golang.org/cl/970041
2010-04-21 16:27:18 -07:00
Russ Cox
1b70b61411 big: fix build - start with zero in scanN
R=gri, eds
CC=golang-dev
https://golang.org/cl/947042
2010-04-20 22:51:48 -07:00
Kyle Consalus
d7b4851586 strings: add ReadRune to Reader
R=rsc
CC=golang-dev
https://golang.org/cl/940041
2010-04-20 22:18:26 -07:00
Evan Shaw
e4136fe91c big: eliminate redundant array lookups
This gives about a 6% performance improvement to pidigits.
Thanks to Russ for the suggestion.

R=rsc, gri
CC=golang-dev
https://golang.org/cl/957041
2010-04-20 21:41:58 -07:00
Evan Shaw
4f445d2744 big: reduce the number of allocations
There was a bug in makeN that caused lots of unnecessary
allocations.  Fixing this exposed a few bugs in other
functions which worked when makeN allocated a new slice, but
failed when it simply resized an existing slice.  The result
is a pretty big performance improvement.  When running
pidigits, here were the numbers I got on amd64:

Before this change:
pidigits 10000
        gcc -O2 pidigits.c -lgmp        2.09u 0.02s 2.11r
        gc pidigits     12.68u 0.04s 12.72r
        gc_B pidigits   12.71u 0.03s 12.75r

After:
pidigits 10000
        gcc -O2 pidigits.c -lgmp        2.09u 0.00s 2.10r
        gc pidigits     6.82u 0.00s 6.85r
        gc_B pidigits   6.55u 0.01s 6.59r

R=rsc, gri
CC=golang-dev
https://golang.org/cl/953042
2010-04-20 21:24:07 -07:00
Evan Shaw
76cbbc8a95 big: Add Lsh and Value; convert pidigits to use big
This yields a pretty significant performance boost to pidigits and there are still some improvements to be made. Here are my numbers:

amd64 w/ bignum:
pidigits 10000
        gcc -O2 pidigits.c -lgmp        2.10u 0.00s 2.10r
        gc pidigits     22.92u 0.02s 22.97r
        gc_B pidigits   22.62u 0.00s 22.65r

amd64 w/ big:
pidigits 10000
        gcc -O2 pidigits.c -lgmp        2.09u 0.02s 2.11r
        gc pidigits     12.68u 0.04s 12.72r
        gc_B pidigits   12.71u 0.03s 12.75r

386 w/ bignum:
pidigits 10000
        gcc -O2 pidigits.c -lgmp        2.09u 0.00s 2.09r
        gc pidigits     44.30u 0.01s 44.35r
        gc_B pidigits   44.29u 0.03s 44.35r

386 w/ big:
pidigits 10000
        gcc -O2 pidigits.c -lgmp        2.10u 0.00s 2.10r
        gc pidigits     22.70u 0.06s 22.79r
        gc_B pidigits   22.80u 0.09s 22.91r

R=rsc, gri
CC=golang-dev
https://golang.org/cl/881050
2010-04-20 20:39:36 -07:00
Russ Cox
20c50cf0f8 runtime: rename cgo2c, *.cgo to goc2c, *.goc
to avoid confusion with real cgo

R=r
CC=golang-dev
https://golang.org/cl/904046
2010-04-20 17:03:25 -07:00
Russ Cox
7295b61cdb reflect: implement Set(nil), SetValue(nil) for PtrValue and MapValue
R=r
CC=golang-dev
https://golang.org/cl/823048
2010-04-20 17:02:08 -07:00
Evan Shaw
73374c93a6 big: Get rid of function pointers and init function
R=rsc, gri
CC=golang-dev
https://golang.org/cl/929041
2010-04-19 19:07:22 -07:00
Kyle Consalus
ad2c5a4984 Added strings.FieldsFunc, a generalization of strings.Fields in style of the strings.Trim*Func functions.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/824051
2010-04-19 16:36:50 -07:00
Andrew Gerrand
3ffbd57b94 syscall: match linux Setsid function signature to darwin
SETSID does return an errno - any reason why it has been done this
way in zsyscall_linux_* ? Otherwise it should be the same as darwin.

From SETSID(2) on my Linux box:

ERRORS
       On error, -1 is returned, and errno is set.

Fixes #730

R=rsc
CC=golang-dev
https://golang.org/cl/878047
2010-04-19 13:12:11 +10:00
Raif S. Naffah
57e764171c reflect: add FieldByNameFunc
xml: add support for XML marshalling embedded structs.

R=rsc
CC=golang-dev
https://golang.org/cl/837042
2010-04-18 15:22:36 -07:00
Michael Hoisie
13f81feb31 net: fix bugs in packStructValue
packStructValue was cutting off last byte of uint32
in _Dns_msg.Unpack, use packRR for rr types

R=rsc
CC=golang-dev
https://golang.org/cl/844048
2010-04-18 14:46:24 -07:00
Russ Cox
3cfa2c3ddf json: scanner, Compact, Indent, and tests
This is the first of probably four separate CLs
for the new implementation of the json package.

The scanner is the core of the new implementation.
The other CLs would be the new decoder,
the new encoder, and support for JSON streams.

R=r
CC=golang-dev
https://golang.org/cl/802051
2010-04-18 14:45:08 -07:00
Rob Pike
3f7da4f861 rpc: Add Close() method to rpc.Client to allow graceful connection teardown.
Fixes #675.

R=rsc, msolo
CC=golang-dev
https://golang.org/cl/882049
2010-04-16 16:17:47 -07:00
Evan Shaw
9ca10b0a5c exp/eval: Always read float literals as base 10
We were letting bignum decide, which caused problems with float literals with a leading 0.

R=gri
CC=golang-dev
https://golang.org/cl/816047
2010-04-15 19:53:35 -07:00
Evan Shaw
ff922fe15a go/ast: Update comment to mention imaginary literals
R=gri
CC=golang-dev
https://golang.org/cl/846050
2010-04-15 18:06:22 -07:00
Evan Shaw
39a2e82ee6 exp/eval: Implement x[lo:]
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/908044
2010-04-15 18:04:24 -07:00
Russ Cox
a318f9d3a4 flag: eliminate unnecessary structs
R=r
CC=golang-dev
https://golang.org/cl/872045
2010-04-15 15:25:46 -07:00
Andrei Vieru
fffac8072e "godoc -src pkg_name" excludes duplicates entries
$ godoc xml | grep Copy\(\)
func (c CharData) Copy() CharData
func (c Comment) Copy() Comment
func (d Directive) Copy() Directive
func (p ProcInst) Copy() ProcInst
func (e StartElement) Copy() StartElement
--------------------------------------------
$ godoc -src xml | grep Copy\(\)
func (c CharData) Copy() CharData
--------------------------------------------
$ godoc -src xml Copy
func (c CharData) Copy() CharData { return CharData(makeCopy(c)) }
--------------------------------------------
The command "godoc -src pkg_name" should output the interface of the named package, but it excludes all duplicate entries. Also the command "godoc -src pkg_name method_name" will output the source code only for one method even if there are more of them with the same name in the same package. This patch set fixes this issue.

R=gri
CC=golang-dev
https://golang.org/cl/883051
2010-04-15 09:50:37 -07:00
Kai Backman
26e846429d support for printing floats:
fmt.Printf("float32 %f\n", float32(1234.56789))
fmt.Printf("float64 %f\n", float64(1234.56789))
->
float32 1234.567871
float64 1234.567890

this is a snapshot. extended instruction support, corner cases
and fixes coming in subseuent cls.

R=rsc
CC=dpx, golang-dev
https://golang.org/cl/876045
2010-04-15 12:43:49 +03:00
Robert Griesemer
0fd00c8bb7 scanner: implement Peek() to look at the next char w/o advancing
R=rsc
CC=golang-dev
https://golang.org/cl/840045
2010-04-14 21:33:34 -07:00
Russ Cox
1baf35e41f bytes: shuffle implementation, making WriteByte 50% faster
R=r
CC=golang-dev
https://golang.org/cl/920041
2010-04-14 01:52:56 -07:00
Russ Cox
c3e54f0988 runtime: better trace for fault due to nil pointer call
R=r
CC=golang-dev
https://golang.org/cl/854048
2010-04-13 22:31:47 -07:00
Alex Brainman
035265975f os, syscall: mingw bug fixes
R=rsc
CC=golang-dev
https://golang.org/cl/815044
2010-04-13 22:30:41 -07:00
Alex Brainman
b07e4d9511 os: mingw version of Readdir() and Stat() implemented
R=rsc
CC=golang-dev
https://golang.org/cl/851045
2010-04-13 16:30:11 -07:00
Rob Pike
1b56947f84 netchan: allow client to send as well as receive.
much rewriting and improving, but it's still experimental.

R=rsc
CC=golang-dev
https://golang.org/cl/875045
2010-04-13 13:49:42 -07:00
Rob Pike
effddcadc4 template: use panic/recover to simplify internal error handling.
R=rsc
CC=golang-dev
https://golang.org/cl/824049
2010-04-13 13:28:08 -07:00
Christopher Wedgwood
74d0302eb9 Remove exp/exception as it's no longer relevant
R=gri, adg
CC=golang-dev, r, rsc
https://golang.org/cl/857048
2010-04-13 10:51:35 +10:00
Rob Pike
c701c38e13 fixes for rpc:
- don't log normal EOF
- fix ServeConn to block as documented

R=rsc, msolo
CC=golang-dev
https://golang.org/cl/886043
2010-04-12 17:14:28 -07:00
Christopher Wedgwood
9149d91888 xml: update documentation to match current coding style
R=rsc, r
CC=golang-dev
https://golang.org/cl/891048
2010-04-12 10:28:50 -07:00
Andrei Vieru
1ab15fac22 fmt format verb %b bug
fmt.Printf("%b", int8(-1)) prints 64 ones instead of 8.
This happens only for signed integers (int8, in16 and int32). I guess it's because of the way the conversion between integer types works. From go spec: "Conversions between integer types. If the value is a signed quantity, it is sign extended to implicit infinite precision ....". And there are several conversions to int64 and uint64 in the fmt package. This pathch solves only half of the problem. On a 32 bit system, an fmt.Printf("%b", int(-1)) should still print 64 ones.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/891049
2010-04-12 10:20:06 -07:00
Christopher Wedgwood
10f7f80fae json: update documentation to match current coding style
R=rsc
CC=golang-dev
https://golang.org/cl/888045
2010-04-11 22:09:34 -07:00
Evan Shaw
d77010547d debug/elf: Fix doc comments
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/849049
2010-04-11 14:49:44 -07:00
Evan Shaw
fa860653ae exp/eval: Fix example and add target to Makefile
R=rsc
CC=golang-dev
https://golang.org/cl/901042
2010-04-11 12:42:19 -07:00
Christopher Wedgwood
ae729a433f archive/tar: update documentation to match current coding style
R=rsc, r
CC=golang-dev
https://golang.org/cl/903044
2010-04-11 10:29:07 -07:00
Christopher Wedgwood
98a5a20c5e nacl: update documentation to match current coding style
R=rsc, r
CC=golang-dev
https://golang.org/cl/822047
2010-04-11 10:19:32 -07:00
Christopher Wedgwood
3fbe7f4f41 testing: update documentation to match current coding style
R=rsc, r
CC=golang-dev
https://golang.org/cl/823045
2010-04-11 10:18:49 -07:00
Andrew Gerrand
adb3b863c9 time: fix comment typo
R=r
CC=golang-dev
https://golang.org/cl/811044
2010-04-11 23:33:25 +10:00
Michael Hoisie
92ac0cfbb2 strings: add IndexRune, Trim, TrimLeft, TrimRight, and the generic equivalents TrimFunc, TrimLeftFunc, TrimRightFunc
R=rsc, r
CC=golang-dev
https://golang.org/cl/799048
2010-04-09 18:57:03 -07:00
Russ Cox
6363542695 runtime: delete malx, skip_depth argument to malloc
remove internal functions from traces in gopprof instead.

R=r
CC=golang-dev
https://golang.org/cl/855046
2010-04-09 15:30:40 -07:00
Russ Cox
08852ffe80 freebsd: fix build, maybe
R=r
CC=golang-dev
https://golang.org/cl/909041
2010-04-09 14:37:53 -07:00
Charles L. Dorian
3c3e68ba32 math: use ** for exponentiation in comments
R=rsc
CC=golang-dev
https://golang.org/cl/908041
2010-04-09 14:37:33 -07:00
Charles L. Dorian
9b1d6332e8 cmath: use ** for exponentiation in comments
R=rsc
CC=golang-dev
https://golang.org/cl/831045
2010-04-09 14:37:26 -07:00
Ian Lance Taylor
a4f8d36ba5 Run initcgo for all amd64 targets, not just GNU/Linux.
This is required to make cgo export work on Darwin.  Note that
this corrects the stack alignment when calling initcgo to that
required by gcc on amd64.

R=rsc
CC=golang-dev
https://golang.org/cl/907041
2010-04-09 14:15:15 -07:00
Ian Lance Taylor
2e20386fc7 Library support for cgo export.
These functions are used to call from a C function back to a
Go function.  This only includes 386 support.

R=rsc
CC=golang-dev
https://golang.org/cl/834045
2010-04-09 13:30:35 -07:00
Ian Lance Taylor
2d0ff3f1a6 Support cgo export on amd64.
R=rsc
CC=golang-dev
https://golang.org/cl/857045
2010-04-09 13:30:11 -07:00
Rob Pike
3ddeef8153 rename os.Dir to os.FileInfo
R=rsc
CC=golang-dev
https://golang.org/cl/902042
2010-04-09 11:36:40 -07:00
Alex Brainman
a17544f283 fix bug in os_test.go checkMode
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/872043
2010-04-08 21:16:05 -07:00
Russ Cox
c60d048594 runtime: fix build (panic) for FreeBSD
R=adg
CC=golang-dev
https://golang.org/cl/867046
2010-04-08 21:13:42 -07:00
Russ Cox
5963dbac08 runtime: turn divide by zero, nil dereference into panics
tested on linux/amd64, linux/386, linux/arm, darwin/amd64, darwin/386.
freebsd untested; will finish in a separate CL.

for now all the panics are errorStrings.
richer structures can be added as necessary
once the mechanism is shaked out.

R=r
CC=golang-dev
https://golang.org/cl/906041
2010-04-08 18:15:30 -07:00
Russ Cox
72157c300b runtime: fix bad status throw
when garbage collector sees recovering goroutine

Fixes #711.

R=r
CC=golang-dev
https://golang.org/cl/869045
2010-04-08 13:24:53 -07:00
Russ Cox
2f0cae46d8 runtime: work around kernel bug in Snow Leopard signal handling
Could not take a signal on threads other than the main thread.
If you look at the spinning binary with dtrace, you can see a
fault happening over and over:

    $ dtrace -n '
    fbt::user_trap:entry /execname=="boot32" && self->count < 10/
    {
        self->count++;
        printf("%s %x %x %x %x", probefunc, arg1, arg2, arg3, arg4);
        stack();
        tracemem(arg4, 256);
    }'

    dtrace: description 'fbt::user_trap:entry ' matched 1 probe
    CPU     ID                    FUNCTION:NAME
      1  17015                  user_trap:entry user_trap 0 10 79af0a0 79af0a0
                  mach_kernel`lo_alltraps+0x12a

             0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f  0123456789abcdef
         0: 0e 00 00 00 37 00 00 00 00 00 00 00 1f 00 00 00  ....7...........
        10: 1f 00 00 00 a8 33 00 00 00 00 00 01 00 00 00 00  .....3..........
        20: 98 ba dc fe 07 09 00 00 00 00 00 00 98 ba dc fe  ................
        30: 06 00 00 00 0d 00 00 00 34 00 00 00 9e 1c 00 00  ........4.......
        40: 17 00 00 00 00 02 00 00 ac 30 00 00 1f 00 00 00  .........0......
        50: 00 00 00 00 00 00 00 00 0d 00 00 00 e0 e6 29 00  ..............).
        60: 34 00 00 00 00 00 00 00 9e 1c 00 00 00 00 00 00  4...............
        70: 17 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00  ................
        80: ac 30 00 00 00 00 00 00 1f 00 00 00 00 00 00 00  .0..............
        90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        a0: 48 00 00 00 10 00 00 00 85 00 00 00 a0 f2 29 00  H.............).
        b0: 69 01 00 02 00 00 00 00 e6 93 04 82 ff 7f 00 00  i...............
        c0: 2f 00 00 00 00 00 00 00 06 02 00 00 00 00 00 00  /...............
        d0: 78 ee 42 01 01 00 00 00 1f 00 00 00 00 00 00 00  x.B.............
        e0: 00 ed 9a 07 00 00 00 00 00 00 00 00 00 00 00 00  ................
        f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

    ...

The memory dump shows a 32-bit exception frame:

    x86_saved_state32

    gs = 0x37
    fs = 0
    es = 0x1f
    ds = 0x1f
    edi = 0x33a8
    esi = 0x01000000
    ebp = 0
    cr2 = 0xfedcba98
    ebx = 0x0907
    edx = 0
    ecx = 0xfedcba98
    eax = 0x06
    trapno = 0x0d
    err = 0x34
    eip = 0x1c9e
    cs = 0x17
    efl = 0x0200
    uesp = 0x30ac
    ss = 0x1f

The cr2 of 0xfedcba98 is the address that the new thread read
to cause the fault, but note that the trap is now a GP fault with
error code 0x34, meaning it's moved past the cr2 problem and on
to an invaild segment selector.  The 0x34 is suspiciously similar
to the 0x37 in gs, and sure enough, OS X forces gs to have
that value in the signal handler, and if your thread hasn't set
up that segment (known as USER_CTHREAD), you'll fault on the IRET
into the signal handler and never be able to handle a signal.

The kernel bug is that it forces segment 0x37 without making sure
it is a valid segment.  Leopard also forced 0x37 but had the courtesy
to set it up first.

Since OS X requires us to set up that segment (using the
thread_fast_set_cthread_self system call), we might as well
use it instead of the more complicated i386_set_ldt call to
set up our per-OS thread storage.

Also add some more zeros to bsdthread_register for new arguments
in Snow Leopard (apparently unnecessary, but being careful).

Fixes #510.

R=r
CC=golang-dev
https://golang.org/cl/824046
2010-04-08 13:24:37 -07:00
Charles L. Dorian
9aa8f95ba8 math: atan2 special cases (negative zero)
Added Signbit(), revised Copysign()

R=rsc
CC=golang-dev
https://golang.org/cl/822045
2010-04-08 13:24:04 -07:00
Russ Cox
24c58174b2 runtime: use explicit flag when finalizer goroutine is waiting
Avoids spurious wakeups during other sleeping by that goroutine.
Fixes #711.

R=r
CC=golang-dev
https://golang.org/cl/902041
2010-04-07 20:38:02 -07:00
Ken Thompson
b57afc2f83 another try at clearing
channel recv data.

R=rsc
CC=golang-dev
https://golang.org/cl/896041
2010-04-06 17:33:43 -07:00
Ken Thompson
dec248c665 change channel read to clear
data just read from the channel.
this will make it easier to
recognize when to garbage
collect and finalize.

R=rsc
CC=golang-dev
https://golang.org/cl/882043
2010-04-06 16:58:52 -07:00
Russ Cox
caa149f73d net: use chan bool instead of chan *netFD to avoid cycle
The cycle is *netFD -> cw chanl *netFD in struct ->
same *netFD in channel read buffer.

Because channels are finalized, the cycle makes them
uncollectable.  A better fix is to make channels not
finalized anymore, and that will happen, but this is
an easy, reasonable workaround until then.

Another good fix would be to zero the channel receive
buffer entry after the receive.  That too will happen.

R=r
CC=golang-dev
https://golang.org/cl/875043
2010-04-06 16:50:27 -07:00
Rob Pike
6431b984db flags: better tests.
R=rsc
CC=golang-dev
https://golang.org/cl/864044
2010-04-06 16:46:52 -07:00
Russ Cox
88ce9ce40c runtime: two proc bug fixes
1. Fix bug in GOMAXPROCS when trying to cut number of procs
Race could happen on any system but was
manifesting only on Xen hosted Linux.

2. Fix recover on ARM, where FP != caller SP.

R=r
CC=golang-dev
https://golang.org/cl/880043
2010-04-06 13:48:31 -07:00
Rob Pike
b26a7a2b88 fix deps.bash. \t does not mean tab in some seds.
also: add /dev/null to the ls args to repair handling of empty dependency lists.

R=rsc
CC=golang-dev
https://golang.org/cl/883045
2010-04-06 10:53:48 -07:00
Giles Lean
ac3cf56d33 syscall package: document that errno is zeroed on success
This is a documentation enhancement only, without any code
change.

The rationale for documenting this precisely is that Unix
programmers who "know" that errno's value is undefined after
a successful system call may be surprised otherwise and
search to be sure that a zero errno may be relied upon after
successful calls.

R=r, rsc1, rsc
CC=golang-dev
https://golang.org/cl/812044
2010-04-06 10:28:55 -07:00
Ian Lance Taylor
0688a97556 GNU/Linux sed requires \? rather than ?. Just use * instead.
R=rsc, r
CC=golang-dev
https://golang.org/cl/810043
2010-04-06 10:23:21 -07:00
Russ Cox
0085e35498 io/ioutil: fix bug in ReadFile when Open succeeds but Stat fails
R=gri
CC=golang-dev
https://golang.org/cl/867044
2010-04-05 23:36:52 -07:00
Russ Cox
6d69fd1fe3 runtime: fix Caller
log: add test of Caller

New regexp in log test is picky and will require some
maintenance, but it catches off-by-one mistakes too.

Fixes #710.

R=gri
CC=esko.luontola, golang-dev
https://golang.org/cl/887043
2010-04-05 23:36:37 -07:00
Russ Cox
a267ff6a81 http: fix documentation example
R=adg
CC=golang-dev
https://golang.org/cl/813043
2010-04-05 22:55:05 -07:00
Charles L. Dorian
2e90f66eff cmath: new package
Complex math function package. Still needs more special case checking.

R=rsc
CC=golang-dev
https://golang.org/cl/874041
2010-04-05 22:10:27 -07:00
Russ Cox
d08728f1e1 deps.bash: be less strict about format of x.go lines
R=iant
CC=golang-dev
https://golang.org/cl/862042
2010-04-05 22:08:07 -07:00
Russ Cox
d89b357f76 runtime: handle malloc > 2GB correctly
R=ken2
CC=golang-dev
https://golang.org/cl/821048
2010-04-05 17:26:59 -07:00
Russ Cox
99d258a2f0 crypto/tls: good defaults
R=agl1
CC=golang-dev
https://golang.org/cl/851041
2010-04-05 14:38:02 -07:00
Russ Cox
6c196015e0 runtime: various arm fixes
* correct symbol table size
  * do not reorder functions in output
  * traceback
  * signal handling
  * use same code for go + defer
  * handle leaf functions in symbol table

R=kaib, dpx
CC=golang-dev
https://golang.org/cl/884041
2010-04-05 12:51:09 -07:00
Conrad Meyer
8abae596da nntp: new package, NNTP client
R=rsc, rsc1
CC=golang-dev
https://golang.org/cl/808041
2010-04-04 23:23:48 -07:00
Robert Griesemer
f08ce18980 debug/proc: fix typo in package documentation
R=rsc
CC=golang-dev
https://golang.org/cl/829044
2010-04-02 16:20:47 -07:00
Alex Brainman
79017aa568 syscall: implementing some mingw syscalls required by os package
R=rsc
CC=golang-dev
https://golang.org/cl/770041
2010-04-02 01:11:17 -07:00
Russ Cox
f75d0d224f runtime: turn run time errors checks into panics
R=ken2, r
CC=golang-dev
https://golang.org/cl/871042
2010-04-01 22:31:27 -07:00
Robert Griesemer
d6589377c6 debug/macho: fix error message format
R=rsc
CC=golang-dev
https://golang.org/cl/836046
2010-04-01 15:58:10 -07:00
Robert Griesemer
4a6dfda4cc debug/macho: don't crash when reading non-Mach-O files
R=rsc
CC=golang-dev
https://golang.org/cl/838046
2010-04-01 15:36:44 -07:00
Russ Cox
ec53627ed5 runtime: correct memory leak in select
* adds pass 3 to dequeue from channels eagerly

various other cleanup/churn:
  * use switch on cas->send in each pass to
    factor out common code.
  * longer goto labels, commented at target
  * be more agressive about can't happen:
    throw instead of print + cope.
  * use "select" instead of "selectgo" in errors
  * use printf for debug prints when possible

R=ken2, ken3
CC=golang-dev, r
https://golang.org/cl/875041
2010-04-01 11:56:18 -07:00
Rob Pike
b12007c4ed testing/regexp: use recover.
R=rsc
CC=golang-dev
https://golang.org/cl/816042
2010-03-31 17:57:50 -07:00
Andrew Gerrand
9b04c9b1ea json: use panic/recover to handle errors in Marshal
R=r, gri
CC=golang-dev
https://golang.org/cl/872041
2010-04-01 11:19:37 +11:00
Nigel Tao
fd3e067e0f Delete xgb from the main repository. It has moved to
http://code.google.com/p/x-go-binding/

R=rsc
CC=golang-dev
https://golang.org/cl/846043
2010-04-01 10:14:42 +11:00
Robert Griesemer
f67c90f941 tabwriter: use panic/recover to handle errors
R=rsc, r
CC=golang-dev
https://golang.org/cl/864042
2010-03-31 16:01:22 -07:00
Rob Pike
7de610cc61 regexp: use panic/recover to handle errors
R=rsc, gri
CC=golang-dev
https://golang.org/cl/821046
2010-03-31 15:58:21 -07:00
Russ Cox
63e878a750 runtime: make type assertion a runtime.Error, the first of many
R=r
CC=golang-dev
https://golang.org/cl/805043
2010-03-31 15:55:10 -07:00
Russ Cox
9b1507b050 gc: implement panic and recover
R=ken2, r, ken3
CC=golang-dev
https://golang.org/cl/831042
2010-03-31 11:46:01 -07:00
Rob Pike
884f3256f0 Unicode: fix stupid typo in comment.
R=rsc
CC=golang-dev
https://golang.org/cl/864041
2010-03-30 18:33:06 -07:00
Rob Pike
4e2b7f8f41 Unicode: provide an ability to supplement the case-mapping tables
in character and string case mapping routines.

Add a custom mapper for Turkish and Azeri.

A more general solution for deriving the case information from Unicode's
SpecialCasing.txt will require more work.

Fixes #703.

R=rsc, rsc1
CC=golang-dev, mdakin
https://golang.org/cl/824043
2010-03-30 17:51:03 -07:00
Russ Cox
7ecefdc03f runtime: fix arm build, slightly.
R=r
CC=golang-dev
https://golang.org/cl/842042
2010-03-30 17:00:27 -07:00
Robert Griesemer
f1c39c13a6 go/printer: follow-up on CL 802043
- more test cases
- comment fixes
- minor unrelated changes as part of investigation of issue 702

R=rsc
CC=golang-dev
https://golang.org/cl/860041
2010-03-30 16:49:51 -07:00
Russ Cox
78547ca132 time: do not segment time strings by character class.
instead use pure substring matching to find template values.

this makes stdZulu unnecessary and allows formats
like "20060102 030405" (used in some internet protocols).

this makes Parse not handle years < 0000 or > 9999 anymore.
that seems like an okay price to pay, trading hypothetical
functionality for real functionality.

also changed the comments on the Time struct to use the
same reference date as the format and parse routines.

R=r
CC=golang-dev
https://golang.org/cl/833045
2010-03-30 14:54:32 -07:00
Russ Cox
8fbe8bee6c syscall: add IPV6 constants
R=r
CC=golang-dev
https://golang.org/cl/848041
2010-03-30 14:32:59 -07:00
Russ Cox
1231382b9e single argument panic on non-darwin and in comments
R=r
CC=golang-dev
https://golang.org/cl/800042
2010-03-30 13:15:16 -07:00
Risto Jaakko Saarelma
ac58f646ac Gofmt preserves newlines in multiline selector expressions.
This is for making the fluent interface idiom usable with gofmt.

R=gri
CC=golang-dev
https://golang.org/cl/802043
2010-03-30 11:46:21 -07:00
Russ Cox
01eaf780a8 gc: add panic and recover (still unimplemented in runtime)
main semantic change is to enforce single argument to panic.

runtime: change to 1-argument panic.
use String method on argument if it has one.

R=ken2, r
CC=golang-dev
https://golang.org/cl/812043
2010-03-30 10:53:16 -07:00
Russ Cox
c7122a3c58 simplify various code using new map index rule
R=r
CC=golang-dev
https://golang.org/cl/833044
2010-03-30 10:51:11 -07:00
Russ Cox
00f9f0c056 single argument panic
note that sortmain.go has been run through hg gofmt;
only the formatting of the day initializers changed.
i'm happy to revert that formatting if you'd prefer.

stop on error in doc/progs/run

R=r
CC=golang-dev
https://golang.org/cl/850041
2010-03-30 10:34:57 -07:00
Christopher Wedgwood
d166d1629a runtime: Remove unused runtime.write from linux/amd64
Also minor reformatting.

R=rsc
CC=golang-dev
https://golang.org/cl/845041
2010-03-29 22:51:39 -07:00
Russ Cox
83727ccf7c runtime: run deferred calls at Goexit
baby step toward panic+recover.

Fixes #349.

R=r
CC=golang-dev
https://golang.org/cl/825043
2010-03-29 21:48:22 -07:00
Robert Griesemer
bc32dd9ec4 go/printer: fix a comment
R=rsc
CC=golang-dev
https://golang.org/cl/826042
2010-03-29 18:41:55 -07:00
Robert Griesemer
671919d19a godoc: support for filtering of command-line output in -src mode
+ various minor cleanups

Usage: godoc -src math Sin

R=rsc
CC=golang-dev
https://golang.org/cl/791041
2010-03-29 18:06:53 -07:00
Rob Pike
570af81e19 Flags: add user-defined flag types. The change is really no code; it's just publishing
the set() method and add() functions.  But we rename add() to Var() for consistency.
Also rename FlagValue to Value for simplicity.

Also, delete the check for multiple settings for a flag.  This makes it possible to
define a flag that collects values, such as into a slice of strings.

type flagVar []string

func (f *flagVar) String() string {
	return fmt.Sprint(v)
}

func (f *flagVar) Set(value string) bool {
	if v == nil {
		v = make(flagVar, 1)
	} else {
		nv := make(flagVar, len(v)+1)
		copy(nv, v)
		v = nv
	}
	v[len(v)-1] = value
	return true
}

var v flagVar

func main() {
	flag.Var(&v, "testV", "multiple values build []string")
	flag.Parse()
	fmt.Printf("v = %v\n", v)
}

R=rsc
CC=golang-dev
https://golang.org/cl/842041
2010-03-29 17:37:22 -07:00
Russ Cox
d99a3da7b2 runtime: a couple more memory stats.
now runtime.MemStats.Sys really is the sum of all the other Sys fields.

R=r
CC=golang-dev
https://golang.org/cl/843041
2010-03-29 17:30:07 -07:00
Robert Griesemer
b880543ffa go/ast: generalized ast filtering
R=rsc
CC=golang-dev
https://golang.org/cl/788041
2010-03-29 15:26:07 -07:00
Rob Pike
299cd38f0a strings.FIelds: slight simplification.
R=rsc
CC=golang-dev
https://golang.org/cl/833042
2010-03-29 13:39:16 -07:00
Russ Cox
a709876767 runtime: more malloc statistics
expvar: default publishings for cmdline, memstats
godoc: import expvar

R=r
CC=golang-dev
https://golang.org/cl/815041
2010-03-29 13:06:26 -07:00
Roger Peppe
a48115bf2e strconv.Unquote could wrongly return a nil error on error.
R=rsc, gri
CC=golang-dev
https://golang.org/cl/773041
2010-03-29 10:09:29 -07:00
Andrew Gerrand
9ba5ec53ad comment typos
Fixes #698.
Fixes #699.

R=rsc
CC=golang-dev
https://golang.org/cl/824041
2010-03-29 16:31:41 +11:00
Andrew Gerrand
a618df0f5b comment typo in crypto/rsa/rsa.go
R=rsc
CC=golang-dev
https://golang.org/cl/823041
2010-03-29 13:13:12 +11:00
Andrew Gerrand
dc6f8321b1 http: add HandleFunc as shortcut to Handle(path, HandlerFunc(func))
R=rsc
CC=golang-dev
https://golang.org/cl/763042
2010-03-29 10:02:37 +11:00
Raif S. Naffah
66dd26e967 xml: use io.ReadByter in place of local readByter
R=cemeyer, rsc
CC=golang-dev
https://golang.org/cl/809041
2010-03-27 23:12:30 -07:00
Robert Griesemer
5a716206a4 fix build
R=r
CC=golang-dev
https://golang.org/cl/790041
2010-03-26 16:33:59 -07:00
Rob Pike
7ffe938f08 regexp: don't return non-nil *Regexp if there is an error.
R=gri
CC=golang-dev
https://golang.org/cl/787041
2010-03-26 16:18:20 -07:00
Russ Cox
baf538406b pprof: dump extra heap information at end of heap profile
R=r
CC=golang-dev
https://golang.org/cl/786041
2010-03-26 15:32:53 -07:00
Russ Cox
4e28cfe970 runtime: run all finalizers in a single goroutine.
eliminate second pass of mark+sweep
by scanning finalizer table specially.

R=r
CC=golang-dev
https://golang.org/cl/782041
2010-03-26 14:15:30 -07:00
Charles L. Dorian
1ec91c8d1d math: add J1, Y1, Jn and Yn (Bessel functions)
Also amend j0.go (variable name conflict, small corrections).

R=rsc
CC=golang-dev
https://golang.org/cl/769041
2010-03-26 14:09:39 -07:00
Giles Lean
ad73de2f5f syscall: Create syscall_bsd.go for code used by Darwin and other *BSDs
In this change I'd like to combine the common code that is
present in syscall_darwin.go and syscall_freebsd.go.  I
have three reasons for wanting to do this now:

1. reducing code duplication is nearly always good :-)
2. the duplication will get worse if I duplicate this code
   a third time for the NetBSD port I'm working on, which
   I need to do almost immediately
3. by making this change all in one lump and ignoring any
   commonality with the syscall_linux*.go files the diff
   is long but, I think, readable

In future it may be possible to cherry pick functions that
also apply to Linux and put them in (say) syscall_unix.go,
and of course some functions may diverge in future and have
to move out to OS or architecture specific files, but today
I want just the low hanging fruit.

Tested and passed on:

  Darwin (Snow Leopard, 10.6): amd64 and 386
  FreeBSD (8.0-RELEASE):       386 only(*)

(*) All my virtualisation software has stopped playing nice
with FreeBSD for the moment, so I don't have facilities to
test the amd64 port.  As the OS X port is OK and the diff
looks all right to my eyes I shall keep my fingers crossed.
If someone with a FreeBSD/amd64 system cares to test and
report I would be appreciative.

2010-03-27 update: I have replaced my virtualisation software, and have working FreeBSD/i386 and FreeBSD/amd64 virtual machines again.

As I hoped (and expected -- programmers are optimists :-) the code built and passed all but the two currently known to fail tests on FreeBSD/amd64. I rechecked FreeBSD/i386 too: same results.

R=rsc
CC=golang-dev
https://golang.org/cl/751041
2010-03-26 13:23:54 -07:00
Robert Griesemer
d0ffee8abf bytes, strings: IndexOfAny
+ first use in go/doc

R=r
CC=golang-dev
https://golang.org/cl/781041
2010-03-26 13:05:04 -07:00
Firmansyah Adiputra
dab40b5880 xgb: fix request length and request size.
R=nigeltao_golang, rsc
CC=golang-dev
https://golang.org/cl/759041
2010-03-26 09:21:09 -07:00
Robert Griesemer
6358e1faf6 godoc: don't convert multi-line functions into one-liners by default
- new heuristic: if both the opening { and closing } braces are on the
  same line, and the function body doesn't contain comments or is other-
  wise too long (e.g. signature too long), it is formatted as a one-line
  function

- related cleanups along the way

- gofmt -w src misc led to no additional changes as expected

R=rsc, rsc1
CC=golang-dev, ken2, r
https://golang.org/cl/758041
2010-03-25 16:59:02 -07:00
Rob Pike
4b40426a90 Add strconv.Atob, Btoa.
Fixes #639

R=rsc
CC=golang-dev
https://golang.org/cl/755041
2010-03-25 11:50:07 -07:00
Christopher Wedgwood
7f2ea938ed syscall: Implement SetsockoptString
R=rsc, r
CC=golang-dev
https://golang.org/cl/739042
2010-03-24 22:36:38 -07:00
Giles Lean
729ccb5751 syscall: bring generated files zsyscall_darwin_*.go
up to date.

No functional change, but when these files are regenerated
they change, leading to noisy diffs when working in the
syscall package.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/705043
2010-03-24 21:59:21 -07:00
Alex Brainman
a24cf69fd8 runtime: fix mingw build, implement missing destroylock()
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/747041
2010-03-24 18:03:10 -07:00
Rob Pike
325cf8ef21 delete all uses of panicln by rewriting them using panic or,
in the tests, println+panic.
gofmt some tests too.

R=rsc
CC=golang-dev
https://golang.org/cl/741041
2010-03-24 16:46:53 -07:00
Russ Cox
6eb251f244 runtime: malloc sampling, pprof interface
R=r
CC=golang-dev
https://golang.org/cl/719041
2010-03-24 09:40:09 -07:00
Charles L. Dorian
6b6c3993d5 math: add J0 and Y0 (Bessel functions)
R=rsc
CC=golang-dev
https://golang.org/cl/661044
2010-03-24 09:25:49 -07:00
Russ Cox
596c16e045 runtime: add memory profiling, disabled.
no way to get the data out yet.

add prototype for runtime.Callers,
missing from last CL.

R=r
CC=golang-dev
https://golang.org/cl/713041
2010-03-23 20:48:23 -07:00
Fumitoshi Ukai
371496e0b8 websocket: implement new protocol
http://www.whatwg.org/specs/web-socket-protocol/
(draft of draft-hixie-thewebsocketprotocol-76)

draft-hixie-thewebsocketprotocol-76 will introduce new handshake
incompatible draft 75 or prior.
http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol

R=rsc
CC=golang-dev
https://golang.org/cl/583041
2010-03-23 18:09:24 -07:00
Giles Lean
2ab9114dd7 Trivial: remove duplicate line #include <sys/types.h>
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/645044
2010-03-23 17:52:16 -07:00
Russ Cox
556ae65d36 fix build - unused import
R=gri
CC=golang-dev
https://golang.org/cl/711041
2010-03-23 17:34:13 -07:00
Russ Cox
2b7d147f1a runtime: add Callers
cut copies of traceback from 6 to 1.

R=r
CC=golang-dev
https://golang.org/cl/703041
2010-03-23 17:01:17 -07:00
Russ Cox
32c39fa1b7 go/printer: avoid reflect in print
R=gri
CC=golang-dev
https://golang.org/cl/704041
2010-03-23 16:56:48 -07:00
Kyle Consalus
a65a56ec1f xml: add line numbers to syntax errors.
R=rsc
CC=golang-dev
https://golang.org/cl/699041
2010-03-23 13:20:16 -07:00
Ken Thompson
e781303e27 maps access to a missing key
will return the "zero" value

R=rsc
CC=golang-dev
https://golang.org/cl/700041
2010-03-23 13:00:02 -07:00
Kyle Consalus
66caa38d49 xml: add CopyToken
R=rsc
CC=golang-dev
https://golang.org/cl/634042
2010-03-23 09:43:20 -07:00
Andrew Gerrand
51a7f1c9d6 ast/printer: support for printing ast.Spec nodes
R=gri
CC=golang-dev
https://golang.org/cl/682041
2010-03-23 09:00:47 +11:00
Russ Cox
b21f3137a4 os: drop File finalizer after normal Close
R=r
CC=golang-dev
https://golang.org/cl/586043
2010-03-19 16:28:32 -07:00
Andrew Gerrand
f4322a848d http: add Error helper function
R=r, rsc
CC=golang-dev
https://golang.org/cl/626042
2010-03-20 10:22:09 +11:00
Charles L. Dorian
26f0c83eb8 math: add Gamma function
R=rsc
CC=golang-dev
https://golang.org/cl/649041
2010-03-19 15:29:22 -07:00
Alex Brainman
64f33880e5 syscall: mingw implemntation of Errstr()
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/621041
2010-03-19 15:21:37 -07:00
Alex Brainman
b0c6bba8e8 syscall: mksyscall_mingw.sh emitting shorter calls (to Syscall or Syscall6) when there are fewer arguments
R=rsc
CC=golang-dev
https://golang.org/cl/622041
2010-03-19 15:17:18 -07:00
Fumitoshi Ukai
f15447ca3e websocket: use URL.RawPath to construct WebSocket-Location: header
R=rsc
CC=golang-dev
https://golang.org/cl/651041
2010-03-19 14:18:02 -07:00
Alex Brainman
71e402d8ff deps.bash: handle Makefiles with .go filenames that include $(GOOS) and $(GOARCH)
R=rsc
CC=golang-dev
https://golang.org/cl/642042
2010-03-19 14:17:07 -07:00
Robert Griesemer
90f7209548 godoc: improved comment formatting: recognize URLs
and highlight special words, if provided. Also:

- related cleanups in src/pkg/go/doc/comment.go
- fix typos in src/cmd/goinstall/doc.go

Fixes #672.

R=rsc
CC=adg, golang-dev
https://golang.org/cl/601042
2010-03-19 13:01:45 -07:00
Andrew Gerrand
c10ccd567d template: fixed html formatter bug where it would turn a []byte
into a string of decimal numbers.

R=r, rsc
CC=golang-dev
https://golang.org/cl/624041
2010-03-19 09:46:39 +11:00
Robert Griesemer
4467037353 rpc documentation cleanup: remove ;'s from code in documentation
R=r
CC=golang-dev
https://golang.org/cl/624042
2010-03-18 14:10:25 -07:00
Robert Griesemer
7f7751837c go/doc cleanup: remove some unnecessary string conversions
R=rsc
CC=golang-dev
https://golang.org/cl/642041
2010-03-18 14:09:17 -07:00
Alex Brainman
8c24fa95aa Fix src/pkg/syscall/mkall.sh: don't assume that . is on PATH.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/614042
2010-03-17 20:07:14 -07:00
Ian Lance Taylor
332ff67ee2 Fix build: don't assume that . is on PATH.
R=rsc
TBR=rsc
CC=golang-dev
https://golang.org/cl/610043
2010-03-17 10:08:27 -07:00
Russ Cox
908efdb5ac crypto/rand: new package
Until proven insufficient, rely on the operating system
to give us good random bytes (/dev/urandom).

R=agl1
CC=golang-dev
https://golang.org/cl/569044
2010-03-16 23:12:20 -07:00
Russ Cox
0c3a93ceb7 runtime: add GOROOT and Version
R=r
CC=golang-dev
https://golang.org/cl/608041
2010-03-16 23:10:33 -07:00
Alex Brainman
5e6203d28b syscall: more changes to mingw version
- mkall now generates syscall stabs automatically
- we can call unicode versions of winapi now
- introduce GetErrstr function to fetch error text given errno
- general cleanup

R=rsc
CC=golang-dev
https://golang.org/cl/562041
2010-03-16 23:10:07 -07:00
Andrew Gerrand
9d930040d7 json: add MarshalIndent (accepts user-specified indent string)
Fixes #661

R=r, rsc, skorobo
CC=golang-dev
https://golang.org/cl/576042
2010-03-17 15:41:16 +11:00
Russ Cox
e153d3d818 syscall: add const ARCH, analogous to OS
R=r
CC=giles, golang-dev
https://golang.org/cl/600041
2010-03-16 18:45:48 -07:00
Russ Cox
141821d512 http: change RawPath to mean raw path, not raw everything-after-scheme.
The new meaning is more useful for both websocket and http.

R=r, petar-m, ukai
CC=golang-dev, madari
https://golang.org/cl/582043
2010-03-16 18:44:55 -07:00
Russ Cox
c75f891a72 utf16: new package
needed for interacting with various legacy interfaces,
like Windows and the Mac OS clipboard.

R=r
CC=golang-dev
https://golang.org/cl/595041
2010-03-16 18:44:37 -07:00
Robert Griesemer
53f3d0733c gofmt: more consistent formatting of const/var decls
- gofmt -w src misc
- only manually modified file: src/pkg/go/printer/nodes.go

R=rsc
CC=golang-dev, r
https://golang.org/cl/606041
2010-03-16 16:45:54 -07:00
Robert Griesemer
74fac99d05 godoc: initial support for showing popup information
for identifiers in Go source code

- at the moment just show identifier kind (var, func, etc.) and name
  (eventually should show declaration, type, etc.)
- JavaScript parts by adg

R=rsc
CC=adg, golang-dev
https://golang.org/cl/578042
2010-03-16 14:17:42 -07:00
Russ Cox
0b986316b8 net: fix IPMask.String not to crash on all-0xff mask
R=r
CC=golang-dev
https://golang.org/cl/438042
2010-03-16 14:16:33 -07:00
Petar Maymounkov
7f4c2caea5 http: add ParseQuery
R=rsc
CC=golang-dev
https://golang.org/cl/238041
2010-03-16 13:57:16 -07:00
Conrad Meyer
899e2e6e0c sha512: add sha384 (truncated version)
R=rsc
CC=golang-dev
https://golang.org/cl/317041
2010-03-16 13:26:21 -07:00
Robert Griesemer
926f59ba14 image/jpeg: fix typos
Fixes #665.

R=nigeltao, nigeltao_golang
CC=golang-dev
https://golang.org/cl/570041
2010-03-15 22:10:47 -07:00
Russ Cox
acfd7b8d12 runtime: lock finalizer table accesses
R=r
CC=golang-dev
https://golang.org/cl/462043
2010-03-15 20:29:17 -07:00
Russ Cox
1a5cd2c0e1 hash/crc64: new package implementing 64-bit CRC
hash/crc32: add Update function
hash: add Sum64 interface

R=r
CC=golang-dev
https://golang.org/cl/445042
2010-03-12 17:38:18 -08:00
Robert Griesemer
67f1becad6 gofmt: make sure there is a newline after
a /*-style comment at the end of a file

Some minor cleanups/typo fixes along the way.

Fixes an issue where that newline was removed
after applying gofmt.

R=r
CC=golang-dev
https://golang.org/cl/476043
2010-03-12 14:54:06 -08:00
Robert Griesemer
ee0c35be85 go/printer: fix a couple of hidden crashes that become
visible only when enabling internal debug mode:
- in rare cases expression depth can underflow
- when printing a single labeled statement, indentation
  may underflow if not setup correctly

R=rsc
CC=golang-dev
https://golang.org/cl/484041
2010-03-12 14:01:52 -08:00
Robert Griesemer
f7c27b9af9 ast/filter.go: missing nil-check causes crash
R=rsc
CC=golang-dev
https://golang.org/cl/461041
2010-03-11 17:39:55 -08:00
Robert Griesemer
3e24f2d6df godoc: fix formatting of -src output
- go/filter.go: make MergePackageFiles smarter
- go/printer.go: handle positions from multiple files

R=rsc
CC=golang-dev
https://golang.org/cl/460042
2010-03-11 16:44:56 -08:00
Robert Griesemer
8107cad45a math, path: minor comment fixes
R=r
CC=golang-dev
https://golang.org/cl/444043
2010-03-11 16:40:32 -08:00
Christopher Wedgwood
698bc461bf syslog: increase test timeout from 10ms to 100ms
Problem pointed out by rsc.

R=rsc
CC=golang-dev
https://golang.org/cl/444041
2010-03-11 09:46:16 -08:00
Robert Griesemer
2a62195153 math package: minor documentation fix
R=rsc
CC=golang-dev
https://golang.org/cl/424041
2010-03-10 17:04:43 -08:00
Andrew Gerrand
a2772a593b template: add ParseFile, MustParseFile, and associated tests
R=r
CC=golang-dev
https://golang.org/cl/391041
2010-03-10 20:19:20 +11:00
Alex Brainman
e00795859b syscall: minimal mingw version of syscall to call windows dlls
lots of missing parts, but builds and can call dlls, see a sample code in syscall_mingw.go

R=rsc
CC=golang-dev
https://golang.org/cl/218042
2010-03-09 15:09:09 -08:00
Dean Prichard
75e5ece03a reflect: typo in comment
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/369041
2010-03-10 10:00:10 +11:00
Rob Pike
9280b746ee fmt: enable the complex tests now that 8g supports complex
R=rsc
CC=golang-dev
https://golang.org/cl/357043
2010-03-09 14:17:14 -08:00
Ken Thompson
f229c8b546 identical complex implementation
for 6g and 8g. can also be used
for 5g. 5g is still a stub.

R=rsc
CC=golang-dev
https://golang.org/cl/362041
2010-03-09 12:49:24 -08:00
Raif S. Naffah
96c9603a43 crypto/ripemd160: new package
R=rsc
CC=golang-dev
https://golang.org/cl/224081
2010-03-08 18:12:36 -08:00
Conrad Meyer
bbec504f60 crypto/sha256: add SHA-224
R=agl1, rsc
CC=golang-dev
https://golang.org/cl/253045
2010-03-08 18:12:30 -08:00
Giles Lean
0ed8231e69 encoding/base64: fix typo in comment
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/258041
2010-03-08 18:12:25 -08:00
Conrad Meyer
5bebadf23f crypto/sha512: new package
R=rsc
CC=golang-dev
https://golang.org/cl/240043
2010-03-08 17:00:04 -08:00
Russ Cox
8ddd6c4181 runtime: clock garbage collection on bytes allocated, not pages in use
This keeps fragmentation from delaying
garbage collections (and causing more fragmentation).

Cuts fresh godoc (with indexes) from 261M to 166M (120M live).
Cuts toy wc program from 50M to 8M.

Fixes #647.

R=r, cw
CC=golang-dev
https://golang.org/cl/257041
2010-03-08 14:15:44 -08:00
Adam Langley
df53544f4f crypto/rsa: don't use safe primes.
Previously we would require safe primes for our RSA key generation.
Since this took rather a long time, this removes the requirement that
the primes be safe.

OpenSSL doesn't use safe primes for RSA key generation either
(openssl-0.9.8l/crypto/rsa/rsa_gen.c:122)

Fixes #649.

R=rsc
CC=golang-dev
https://golang.org/cl/253041
2010-03-08 09:25:24 -05:00
Christopher Wedgwood
520621d24c regex: Remove unneeded imports from test.
R=rsc, adg, r
CC=golang-dev
https://golang.org/cl/264041
2010-03-07 11:17:36 -08:00
Andrew Gerrand
f25e016c60 regexp: add ReplaceAllFunc and ReplaceAllStringFunc
R=r
CC=golang-dev
https://golang.org/cl/247041
2010-03-07 12:41:49 +11:00
Rob Pike
cba81d8058 fix bug in complex printing: imaginary didn't have same format as real.
add tests.

R=rsc, ken2, ken3
CC=golang-dev
https://golang.org/cl/261041
2010-03-06 13:38:14 -08:00
Ken Thompson
788b41751e PTAL
R=r
CC=golang-dev
https://golang.org/cl/254043
2010-03-06 11:26:33 -08:00
Ken Thompson
426099f42e 6g complex type usable
8g and 5g have stubs to ignore complex

R=rsc
CC=golang-dev
https://golang.org/cl/257042
2010-03-05 20:16:04 -08:00
Charles L. Dorian
067fe2840b math: faster hypot
Use hardware sqrt for faster hypot; preserve software-only
hypot as hypotGo (like sqrtGo); enable benchmarking of
hypotGo.

R=rsc
CC=golang-dev
https://golang.org/cl/229049
2010-03-05 16:45:39 -08:00
Rob Pike
8c9944d8c8 bufio: WriteRune
also fix a printing error in the test for bytes.Buffer

R=golang-dev
CC=golang-dev
https://golang.org/cl/240042
2010-03-05 14:03:17 -08:00
Adam Langley
308064fc59 big: fix mistakes with probablyPrime
probablyPrime would return false negatives in some cases.

This code has now been tested against GMP for several million iterations without issues.

Fixes #638.

R=rsc
CC=golang-dev
https://golang.org/cl/252041
2010-03-05 15:55:26 -05:00
Rob Pike
0ac5ef70db Add ReadRune and WriteRune to bytes.Buffer
The comments mention bufio's WriteRune, which should come next.

R=rsc
CC=golang-dev
https://golang.org/cl/245041
2010-03-05 11:34:53 -08:00
Robert Griesemer
a145829873 frexp.go: remove html from comment
R=r
CC=golang-dev
https://golang.org/cl/250041
2010-03-05 10:30:50 -08:00
Robert Griesemer
9a65a06e37 godoc: don't throw away function documentation
if there are multiple functions (for a package, type)
with the same name

Fixes #642.

R=rsc
CC=golang-dev
https://golang.org/cl/243041
2010-03-05 10:13:58 -08:00
Robert Griesemer
e8a049b440 gofmt: modified algorithm for alignment of multi-line composite/list entries
- only manual changes are in src/pkg/go/printer/nodes.go
- use a heuristic to determine "outliers" such that not entire composites are
  forced to align with them
- improves several places that were not unligned before due too simple heuristic
- unalignes some cases that contain "outliers"
- gofmt -w src misc

Fixes #644.

R=rsc, r
CC=golang-dev
https://golang.org/cl/241041
2010-03-04 17:37:15 -08:00
Spring Mc
3dcbf73c84 strings: make Split(s, "", n) faster
R=rsc
CC=golang-dev
https://golang.org/cl/223096
2010-03-04 16:15:51 -08:00
Russ Cox
36c5c5bf40 cc: disallow ... argument unless NOSPLIT is set.
check that NOSPLIT functions don't use too much stack.
correct some missing NOSPLITs in the runtime library.

Fixes bug reported in
https://groups.google.com/group/golang-nuts/t/efff68b73941eccf

R=ken2
CC=golang-dev
https://golang.org/cl/236041
2010-03-04 15:34:25 -08:00
Charles L. Dorian
6b80a5fa6d math: added ilogb, logb, remainder, tests and special conditions
Also added expm1_386 and remainder_386; shortened exp_386

R=rsc
CC=golang-dev
https://golang.org/cl/217109
2010-03-03 18:17:13 -08:00
Russ Cox
e53f7d8993 net: put [ ] around IPv6 addresses for Dial
Update #538.

R=r
CC=golang-dev
https://golang.org/cl/229045
2010-03-03 17:30:39 -08:00
Russ Cox
74b131c0ab net: fix nil deref in testTimeout when Dial fails
Pointed out by Scott Schwartz.

Fixes #637.

R=scotts
CC=golang-dev
https://golang.org/cl/225042
2010-03-03 17:30:29 -08:00
Rob Pike
90367756bb encoding/binary: fix error reporting bug
R=rsc
CC=golang-dev
https://golang.org/cl/224096
2010-03-03 12:35:16 -08:00
Stephen Ma
3b82f295b4 net: fix network timeout boundary condition.
Fixes #472.

R=golang-dev
CC=golang-dev
https://golang.org/cl/223108
2010-03-03 18:43:36 +11:00
Stephen Ma
b73e592ed1 net: correct DNS configuration
Set defaults to the same values as various C DNS resolver libraries.
Use the timeout value from the configuration.
Fixes #632.

R=rsc
CC=golang-dev
https://golang.org/cl/223094
2010-03-03 15:25:26 +11:00
Ken Thompson
7d4b1e4c0d more on type complex.
getting close.

R=rsc
CC=golang-dev
https://golang.org/cl/224105
2010-03-02 18:32:11 -08:00
Robert Griesemer
305f5433f3 gofmt: fix alignment of multi-line var declarations
- gofmt -w src misc

R=rsc, r
CC=golang-dev
https://golang.org/cl/223101
2010-03-02 17:23:07 -08:00
Andrew Gerrand
adf1e4c5fd http: corrected comment for Response.GetHeader.
Fixes #622.

R=rsc
CC=golang-dev
https://golang.org/cl/224084
2010-03-03 08:53:22 +11:00
Robert Griesemer
f44fa9b4c7 gofmt: experiment: align values in map composites where possible
- gofmt -w src misc
- looking for feedback

R=rsc, r
CC=golang-dev
https://golang.org/cl/223076
2010-03-02 13:46:51 -08:00
Andrey Mirtchovski
1f3222a57b strings.Bytes -> []byte for documentation example, src/pkg/* comments, and htmlgen.go
R=rsc, adg
CC=golang-dev
https://golang.org/cl/224087
2010-03-02 11:18:22 +11:00
Stephen Ma
a627d61d5d Count utf8 runes, not bytes when determining string width. Note
that pad() still counts bytes, but it's currently only used for
1 byte runes.

Fixes #612.

R=r
CC=golang-dev
https://golang.org/cl/217064
2010-02-28 21:15:56 +11:00
Russ Cox
fe746055a2 testing/benchmark: paranoia - make sure n always grows
R=wcn
CC=golang-dev
https://golang.org/cl/223075
2010-02-26 17:18:43 -08:00
Raif S. Naffah
ef531c2b57 crypto/blowfish: new package
R=rsc
CC=golang-dev
https://golang.org/cl/217116
2010-02-26 15:24:46 -08:00
Robert Griesemer
059bc2742a go/parser cleanup: remove some state by writing more functional code
R=rsc
CC=golang-dev
https://golang.org/cl/223071
2010-02-26 14:50:12 -08:00
Robert Griesemer
9520a68268 go/scanner: the position of '\n's chars must be the last position of the current line
Background: This didn't matter until recently, because '\n' don't appear as token starts
in source code and thus the exact position was irrelevant (and set as was easiest in the
code). With auto semicolon insertion, a virtual semicolon may be inserted when a '\n' is
seen. The position of the semicolon is the position of the '\n'. Without this fix, these
semicolons appeared on the next line instead of the line where they were inserted.  This
affected the association of comments to declarations in the parser. As a result, some
lead comments where considered line comments, not collected in the ast, and not shown in
godoc pages. (This affected only godoc pages, not gofmt-formatted programs).

Fixes #592.

R=rsc
CC=golang-dev
https://golang.org/cl/224068
2010-02-26 11:23:12 -08:00
Micah Stetson
8c5404746f Fix a couple of bugs referencing data values in template.
Adds tests and fixes for two cases that fail with the current release.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/217115
2010-02-26 18:39:43 +11:00
Russ Cox
8fbd5f8a82 use []byte("abc") in place of []byte{'a', 'b', 'c'}
R=gri
CC=golang-dev
https://golang.org/cl/223059
2010-02-25 16:43:43 -08:00
Robert Griesemer
d177539877 go/printer, gofmt: align comments in multi-line expression lists
- gofmt -w src misc
- improves several lists and fixes minor degradation introduced
  with the fix for issue 628
- removed some dead code (stringList)

R=rsc
CC=golang-dev
https://golang.org/cl/223058
2010-02-25 16:07:55 -08:00
Russ Cox
9750adbbad strings: delete Runes, Bytes
gofmt -w -r 'strings.Bytes(a) -> []byte(a)' src/cmd src/pkg test/bench
gofmt -w -r 'strings.Runes(a) -> []int(a)' src/cmd src/pkg test/bench
delete unused imports

R=r
CC=golang-dev
https://golang.org/cl/224062
2010-02-25 16:01:29 -08:00
Robert Griesemer
dfaa6eaa76 tabwriter: make use of new []byte() conversion
R=rsc
CC=golang-dev
https://golang.org/cl/224063
2010-02-25 15:54:12 -08:00
Russ Cox
3910161307 gc: implement []int(string) and []byte(string)
R=ken2
CC=golang-dev
https://golang.org/cl/224060
2010-02-25 15:11:07 -08:00
Stephen Weinberg
b86c0b0c4a Fix small typo in net package.
R=rsc
CC=golang-dev
https://golang.org/cl/224061
2010-02-25 14:49:14 -08:00
Robert Griesemer
dbe0b57012 go/printer, gofmt: correct indentation after certain /*-style comments
- applied gofmt to src and misc

Note: This fix improved formatting of src/pkg/math/all_test.go but leads
to a degradation in src/pkg/exp/4s/xs.go. The latter happened to "work"
before accidentally. Fixing the alignment in that case in general will
be a separate CL.

Fixes #628.

R=rsc
CC=golang-dev
https://golang.org/cl/223054
2010-02-25 13:47:16 -08:00
Robert Griesemer
e0d5177dd7 tabwriter: indicate section breaks if Debug flag is set
R=rsc
CC=golang-dev
https://golang.org/cl/224057
2010-02-25 13:26:55 -08:00
Ian Lance Taylor
bada653f4d Use consistent types in .h file and .c file.
R=rsc
CC=golang-dev
https://golang.org/cl/224053
2010-02-25 10:13:09 -08:00
Robert Griesemer
859e4d51c3 strings: remove a couple of redundant tests
(per suggestion from Heresy.Mc@gmail.com)

R=rsc
CC=golang-dev
https://golang.org/cl/223052
2010-02-25 10:02:39 -08:00
Kevin Ballard
20834d644f path: Fix bug in Match with non-greedy stars
path.Match() errors out when testing "*x" against "xxx"
because it matches the star non-greedily. Ensure that
the last chunk consumes the rest of the name.

R=r, rsc
CC=golang-dev
https://golang.org/cl/223050
2010-02-25 09:15:52 -08:00
Rob Pike
24ee7f799c %q in fmt: if the object is a Stringer, use String() to get the value to quote.
R=rsc
CC=golang-dev
https://golang.org/cl/224051
2010-02-25 17:29:37 +11:00
Robert Griesemer
d5248c4a96 go/scanner: support for complex (imaginary) constants
R=rsc
CC=golang-dev
https://golang.org/cl/223044
2010-02-24 17:06:40 -08:00
Ian Lance Taylor
7c99dcbdf9 Install runtime.h and cgocall.h.
This permits cgo generated code to use these header files even
if the Go sources are not around.

R=rsc
CC=golang-dev
https://golang.org/cl/224045
2010-02-24 17:00:25 -08:00
Robert Griesemer
ef0be41e20 go/ast: streamline representation of field lists
- always include position information about opening/closing parens/braces
- replace uses of []*ast.Field with *ast.FieldList

Fixes #473.

R=rsc
CC=golang-dev
https://golang.org/cl/223043
2010-02-24 16:17:11 -08:00
Russ Cox
78961ed961 path: add Match
R=eridius, r, rog
CC=golang-dev
https://golang.org/cl/217088
2010-02-24 16:11:14 -08:00
Russ Cox
37666561b2 http: fix handling of Close, use Close in http.Post
default to HTTP/1.1

R=petar-m
CC=golang-dev
https://golang.org/cl/224041
2010-02-24 15:13:39 -08:00
Robert Griesemer
1be05bbe1e gofmt: don't print ()'s around function-typed results (not needed anymore)
- add extra test cases to go/printer tests
- apply gofmt to src and misc

R=rsc
CC=golang-dev
https://golang.org/cl/223041
2010-02-24 13:24:37 -08:00
Robert Griesemer
228903c5da go/printer: use general comment intersperse mechanism everywhere
- remove several TODOs
- as a side-effect, comment stylers are now used always and comments
  will be properly colored in godoc pkg documentation pages (and not
  only when looking at source text)

R=rsc
CC=golang-dev
https://golang.org/cl/222041
2010-02-24 11:06:46 -08:00
Mark Zavislak
6a0af8e118 crypto package documentation fix
Replaces stale references to modes.go.

R=golang-dev, agl, rsc
CC=golang-dev
https://golang.org/cl/218071
2010-02-23 12:01:09 -08:00
Russ Cox
8ba5c5593f runtime: work around Linux kernel bug in futex
Fixes #420.

R=r
CC=golang-dev
https://golang.org/cl/218065
2010-02-22 20:45:36 -08:00
Russ Cox
5c2197ac8f net: disable UDP server test
has been flaking on various architectures.
not sure why, but doesn't seem to be Go's fault.

Fixes #617.

R=r
CC=golang-dev
https://golang.org/cl/217093
2010-02-22 20:38:56 -08:00
Charles L. Dorian
78e918ccba math: add lgamma; in-line special cases of acosh, nextafter
Added lgamma.go, tests and special cases.

R=rsc
CC=golang-dev
https://golang.org/cl/217060
2010-02-22 17:12:48 -08:00
Nigel Tao
2ac3df210b Fix xgb/example.go typo.
R=adg
CC=golang-dev
https://golang.org/cl/210047
2010-02-23 11:54:57 +11:00
Robert Griesemer
b0fba898ef go/printer (gofmt): remove more residue from semicolon transition
minor unrelated cleanups

R=rsc
CC=golang-dev
https://golang.org/cl/217086
2010-02-22 15:41:59 -08:00
Petar Maymounkov
39e91f8858 http: use RawURL in Request.Write
R=rsc
CC=golang-dev
https://golang.org/cl/217066
2010-02-22 15:39:30 -08:00
Michael Hoisie
1a37656b7a xml: treat bool as value in Unmarshal
R=rsc
CC=golang-dev
https://golang.org/cl/218050
2010-02-22 15:21:13 -08:00
Petar Maymounkov
e465ad3cbd http: fix bug in Post
R=rsc
CC=golang-dev
https://golang.org/cl/217059
2010-02-22 14:46:59 -08:00
Sergei Skorobogatov
7870672c7f json: fix quoted strings in Marshal
R=rsc
CC=golang-dev
https://golang.org/cl/217047
2010-02-22 14:32:40 -08:00
Robert Griesemer
22e960547f scanner: match go/scanner and disallow NUL character;
also check for illegal UTF-8 sequences

R=rsc
CC=golang-dev
https://golang.org/cl/218061
2010-02-22 14:21:59 -08:00
Michael Hoisie
0485a999ff http request URI should never be empty
R=rsc, adg
CC=golang-dev
https://golang.org/cl/217071
2010-02-21 19:49:43 -08:00
Ken Thompson
f59cb49a5a fixed bug in mpconst float multiply by 0.
more complex -- constants, variables and print.

R=rsc
CC=golang-dev
https://golang.org/cl/217061
2010-02-19 20:42:50 -08:00
Timo Savola
4f8a000e17 websocket: fix binary frame size decoding
R=ukai, rsc
CC=golang-dev
https://golang.org/cl/166074
2010-02-19 18:40:09 -08:00
Robert Griesemer
989ef60509 go/ast: use a slice instead of a linked list for the list of comments
(this will simplify some further changes)
removed several TODOs

R=rsc
CC=golang-dev
https://golang.org/cl/216059
2010-02-19 17:03:09 -08:00
Robert Griesemer
8e714aab2b - removed exp/parser (support for old semicolon syntax)
- go/ast: removed StringList (not needed anymore)
- go/ast: changed import path and field list tag to a single string
- updated all dependencies

R=rsc
CC=golang-dev
https://golang.org/cl/217056
2010-02-19 16:01:31 -08:00
Petar Maymounkov
1480ce373e http: unified body transfer (read & write) logic in http.Request/Response.
Compliance issue addressed here: POST requests carrying form data are required
to use "identity" transfer encoding by common nginx and apache server configurations,
e.g. wordpress.com (and many others). So, Request needed to be able to send
non-chunked encodings.

Thus, Request is extended to support identity and chunked encodings, like
Response.  Since the Read() and Write() logic are shared by both (and are
quite long), it is exported in a separate file transfer.go.

R=rsc
CC=golang-dev
https://golang.org/cl/217048
2010-02-19 08:38:40 -08:00
Petar Maymounkov
8d9c2b2eab http: add Pending method to ServerConn, ClientConn
R=rsc
CC=golang-dev
https://golang.org/cl/216052
2010-02-19 08:21:21 -08:00
Adam Langley
32c3c95339 crypto/x509: support certificate creation.
R=rsc
CC=golang-dev
https://golang.org/cl/212041
2010-02-19 10:55:41 -05:00
Petar Maymounkov
55828cee94 http: add DumpRequest, DumpResponse, for debugging
R=rsc
CC=golang-dev
https://golang.org/cl/206050
2010-02-19 07:51:51 -08:00
Petar Maymounkov
d26e204514 http: persistent connection objects
R=rsc
CC=golang-dev
https://golang.org/cl/203051
2010-02-18 23:38:21 -08:00
Petar Maymounkov
e3b94edc03 http: do not edit Response.ContentLength in Response.Write
R=rsc
CC=golang-dev
https://golang.org/cl/207061
2010-02-18 23:38:17 -08:00
Kai Backman
c0aac20e20 combined pchw and embedded into tiny. added section on arm to README
R=rsc
CC=golang-dev
https://golang.org/cl/194151
2010-02-18 23:33:21 -08:00
Charles L. Dorian
c3fa32c747 math: add Cbrt and Sincos; x87 versions of Sincos, Frexp, Ldexp
Added special condition and benchmarks for Cbrt, Sincos. Took Frexp and Ldexp out of bits.go.

R=rsc
CC=golang-dev
https://golang.org/cl/206084
2010-02-18 23:33:15 -08:00
Amrut Joshi
d8675d25e5 xml: allow unquoted attribute values in non-Strict mode
HTML4 standard supports unquoted attibute values in certain cases
(http://www.w3.org/TR/REC-html40/intro/sgmltut.html#h-3.2.2).

R=rsc
CC=golang-dev
https://golang.org/cl/207095
2010-02-18 23:32:55 -08:00
Fumitoshi Ukai
2161e3e23e http: avoid server crash on malformed client request
R=r, rsc
CC=golang-dev
https://golang.org/cl/206079
2010-02-18 18:32:40 -08:00
Russ Cox
c2dea2196c exec: add dir argument to Run.
fix, test MergeWithStdout

R=r
CC=golang-dev
https://golang.org/cl/214046
2010-02-18 18:32:33 -08:00
Dean Prichard
86b0ea6447 sync: allow to work on armv5
asm_arm.s was using ldrex which does not work
on armv5. Tested on Sheevaplug.

R=rsc, kaib
CC=golang-dev
https://golang.org/cl/214049
2010-02-18 15:37:16 -08:00
Ken Thompson
713e3e1541 more complex - constants
import and export

R=rsc
CC=golang-dev
https://golang.org/cl/214050
2010-02-18 14:46:28 -08:00
Ken Thompson
33d6a260c1 new types complex, complex64 and complex128
only front-end compiler work.
best to do thin in 3 steps
1. frontend
2. backend
3. lib

R=rsc
CC=golang-dev
https://golang.org/cl/214042
2010-02-17 22:08:30 -08:00
Robert Griesemer
cd72f77f23 apply gofmt to src and misc
R=rsc
CC=golang-dev
https://golang.org/cl/213041
2010-02-17 15:46:46 -08:00