Russ Cox
3b858fb808
net: turn off empty packet test by default
...
Fixes #374 .
R=r
https://golang.org/cl/166053
2009-12-03 22:19:55 -08:00
Michael Elkins
f3d63bea42
Add Count, Cycle, ZipWith, GroupBy, Repeat, RepeatTimes, Unique to exp/iterable.
...
Modify iterFunc to take chan<- instead of just chan.
R=rsc, dsymonds1
CC=golang-dev, r
https://golang.org/cl/160064
2009-12-03 20:03:07 -08:00
Adam Langley
e93132c982
crypto/rsa: fix shadowing error.
...
Fixes bug 375.
R=rsc
https://golang.org/cl/165045
2009-12-03 19:33:23 -08:00
Russ Cox
cf37254b1c
runtime: fix Caller crash on 386.
...
Fixes #176 .
R=r
https://golang.org/cl/166044
2009-12-03 17:24:14 -08:00
Russ Cox
7e5055ceea
runtime: malloc fixes
...
* throw away dead code
* add mlookup counter
* add malloc counter
* set up for blocks with no pointers
Fixes #367 .
R=r
https://golang.org/cl/165050
2009-12-03 17:22:23 -08:00
Rob Pike
10a349a7c1
The String() method requires global state that makes it not work outside of this package,
...
so make it a local method (_String()).
R=rsc
CC=golang-dev
https://golang.org/cl/165049
2009-12-03 17:14:32 -08:00
Rob Pike
fcc4dd6d64
error propagation in gob/encoder.
...
R=rsc
CC=golang-dev
https://golang.org/cl/165048
2009-12-03 17:12:57 -08:00
Rob Pike
bc3e34759c
Add ReadFrom and WriteTo methods to bytes.Buffer, to enable i/o without buffer allocation.
...
Use them in Copy and Copyn.
Speed up ReadFile by using ReadFrom and avoiding Copy altogether (a minor win).
R=rsc, gri
CC=golang-dev
https://golang.org/cl/166041
2009-12-03 12:56:16 -08:00
Robert Griesemer
6db683fe4d
- include type-associated consts and vars when filtering a PackageDoc
...
- fixes a godoc issue (for instance, "godoc os EOF" now shows an entry)
R=r
CC=rsc
https://golang.org/cl/165042
2009-12-03 11:25:20 -08:00
Rob Pike
d984f98996
minor improvement to formatting: don't allocate padding strings every time.
...
R=rsc
https://golang.org/cl/164090
2009-12-03 00:04:40 -08:00
Rob Pike
b0683bd77a
move ReadFile, WriteFile, and ReadDir into a separate io/ioutil package.
...
this breaks the dependency of package io on package bytes.
R=rsc
CC=golang-dev
https://golang.org/cl/163085
2009-12-02 22:02:14 -08:00
Peter Froehlich
1eba218e44
Runes: turn string into []int
...
Split: fixed typo in documentation
R=rsc, r, r1
https://golang.org/cl/157170
2009-12-02 20:47:38 -08:00
Robert Griesemer
dc7355a974
Add flag -tabindent to gofmt: forces use of
...
tabs for indentation even if -spaces is set.
Changes to gofmt:
- added -tabindent flag
- don't recompute parser and printer mode repeatedly
Changes to go/printer:
- provide new printing mode TabIndent
Changes to tabwriter:
- implement new mode TabIndent to use tabs independent
of the actual padding character for leading empty columns
- distinguish between minimal cell width and tab width
(tabwidth is only used if the output contains tabs,
minwidth and padding are always considered)
- fixed and added more comments
- some additional factoring
By default, -tabindent is disabled and the default gofmt
behavior is unchanged. By setting -spaces and -tabindent,
gofmt will use tabs for indentation but do any other
alignment with spaces. This permits a user to change the
visible indentation by simply changing the editor's tab
width and the code will remain properly aligned without
the need to rerun gofmt.
R=rsc
https://golang.org/cl/163068
2009-12-02 16:57:15 -08:00
Russ Cox
e89441ba8f
net: test and fix support for 0-length datagram packets.
...
Fixes #274 .
R=r
CC=jonathan.r.hudson
https://golang.org/cl/163072
2009-12-02 15:17:49 -08:00
Robert Griesemer
d8bc797ed5
apply gofmt to json files
...
R=rsc
https://golang.org/cl/164071
2009-12-02 11:40:54 -08:00
Rob Pike
114f73f822
fix segfault printing errors. add test case and improve messages.
...
Fixes #338 .
R=rsc
CC=golang-dev
https://golang.org/cl/163083
2009-12-02 10:41:28 -08:00
Rob Pike
f6c0eba741
test that arrays work properly.
...
can't mix slices and arrays now; perhaps that should be a TODO
R=rsc
https://golang.org/cl/164079
2009-12-02 10:25:14 -08:00
Russ Cox
9e55d0d018
time: another bug in SecondsToUTC.
...
added random test to look for more.
Fixes #363 .
R=r, cw
https://golang.org/cl/163071
2009-12-02 08:27:57 -08:00
Ian Lance Taylor
952b91e4ad
Add Shutdown to 32-bit GNU/Linux build.
...
Submitting as a TBR to fix the build.
R=dho, rsc
https://golang.org/cl/164078
2009-12-02 08:24:14 -08:00
Russ Cox
8d652ee8ce
time: fix handling of Jan 1 1601, 1201, 801, ...
...
R=r
CC=hurtonm
https://golang.org/cl/164074
2009-12-01 23:38:06 -08:00
Devon H. O'Dell
eb16346dac
net: fix netFD.Close races
...
Fixes #271 .
Fixes #321 .
R=rsc, agl, cw
CC=golang-dev
https://golang.org/cl/163052
2009-12-01 23:28:57 -08:00
Rob Pike
ff3ea68e52
explicitly catch attempt to decode into a value - must be a pointer to see the result.
...
R=rsc
https://golang.org/cl/163070
2009-12-01 21:47:00 -08:00
Rob Pike
f9810f1b12
make io.ReadFile use Stat.Size as a hint for preallocation
...
R=rsc
CC=golang-dev
https://golang.org/cl/163069
2009-12-01 21:44:24 -08:00
Devon H. O'Dell
49ebcfbb83
Add syscall.Shutdown to FreeBSD i386/amd64
...
Necessary for 163052
R=rsc
CC=golang-dev
https://golang.org/cl/164068
2009-12-01 21:43:39 -08:00
Russ Cox
0b126c1be4
syscall: add Shutdown on OS X, add more constants in mkerror.sh
...
R=dho
CC=golang-dev
https://golang.org/cl/163061
2009-12-01 16:53:43 -08:00
Rob Pike
ceb1fe2863
update package unicode to Unicode 5.2
...
R=rsc
CC=golang-dev
https://golang.org/cl/163062
2009-12-01 16:22:21 -08:00
Russ Cox
2a54997baa
gob: fix build
...
TBR=r
https://golang.org/cl/163064
2009-12-01 16:18:27 -08:00
Christopher Wedgwood
4f6dbc6901
Explicitly return values where it's shadowing the parameter.
...
Bad returns noticed by "Devon H. O'Dell" <devon.odell@gmail.com>.
Resolves Issue 360.
R=rsc, dho, agl, agl1
CC=ukai
https://golang.org/cl/163055
2009-12-01 15:54:49 -08:00
Rob Pike
a0f742d343
more gob bugs
...
1) need to send slice and array types (was only sending element types)
2) compatibleType needs to use decoder's type map
R=rsc
CC=golang-dev
https://golang.org/cl/164062
2009-12-01 15:31:28 -08:00
Tor Andersson
598f3e284e
A first stab at porting the XCB X11 protocol bindings to go.
...
The python script needs a checkout of xcb/proto to generate
an xproto.go file, which together with xgb.go provide functions
to access all of the core X11 protocol requests. I have included the
generated file.
Extensions and authentication methods are not implemented.
R=r, rsc, nigeltao_golang
https://golang.org/cl/162053
2009-11-30 14:25:50 -08:00
Sergey 'SnakE' Gromov
9d50b468a1
json: Decode into native Go data structures
...
This patch adds an ability to convert JSON-encoded data into
a hierarchy of Go's native data types.
R=rsc
CC=golang-dev
https://golang.org/cl/161060
2009-11-30 13:55:09 -08:00
Robert Griesemer
c1767dbdda
Typo in comment.
...
Fixes #358 .
R=rsc
CC=r
https://golang.org/cl/164043
2009-11-30 12:50:02 -08:00
Péter Szabó
12206f64dd
sync.RWMutex: rewritten to add support for concurrent readers.
...
Also made sync.xadd public to help testing sync.RWMutex.
Also added unit tests for sync.RWMutex.
R=rsc
https://golang.org/cl/162044
2009-11-30 12:10:56 -08:00
Jonathan Wills
229807c8c3
Added a method on UDPConn so they can actually send broadcast packets.
...
R=rsc
https://golang.org/cl/162046
2009-11-30 12:03:55 -08:00
Christopher Wedgwood
a85c258e67
a[b:len(a)] -> a[b:]
...
R=r, rsc
CC=agl1
https://golang.org/cl/161070
2009-11-30 12:03:43 -08:00
Andrew Skiba
68d3b6e51a
Handle \r as a whitespace when parsing JSON string.
...
Fixes #272 .
R=rsc
https://golang.org/cl/161061
2009-11-30 12:03:26 -08:00
Christopher Wedgwood
c78710f53e
Add trivial whitespace to CorruptInputError strings.
...
R=r, rsc
https://golang.org/cl/161058
2009-11-30 12:03:10 -08:00
Christopher Wedgwood
f0c9719540
Minimise bitrot: bytes.Copy -> copy
...
(compile tested only)
R=r, rsc
https://golang.org/cl/161069
2009-11-30 11:57:21 -08:00
Russ Cox
ed62d27a52
template: two bug fixes / nits
...
* diagnose template not created with New
(current code just crashes)
* write []byte uninterpreted
(current code writes fmt format: "[65 65 65 65]")
R=r
CC=golang-dev
https://golang.org/cl/161075
2009-11-30 10:29:14 -08:00
Russ Cox
be98bc488e
websocket: avoid $GOROOT in case it has spaces
...
Fixes #115 .
R=r, ukai, sergio
https://golang.org/cl/162057
2009-11-29 20:30:02 -08:00
Sergio Luis O. B. Correia
46892656c7
crypto/md4, exp/draw/x11: fix makefile to build when GOROOT has whitespaces
...
this is the exact same thing issue #115 is about. fix makefiles to use relative
path to work in the case we have whitespaces as part of GOROOT.
R=rsc
https://golang.org/cl/162055
2009-11-29 18:14:49 -08:00
Fumitoshi Ukai
f9f0184e13
Add WebSocket server framework hooked into http.
...
R=r, rsc
https://golang.org/cl/156071
2009-11-29 14:22:44 -08:00
Robert Griesemer
f3e0f214f8
Correct expression level for argument lists.
...
Fixes #352 .
R=rsc
https://golang.org/cl/161073
2009-11-29 14:11:52 -08:00
Rob Pike
b5358e0630
a few utf8 benchmarks. on my mac:
...
utf8_test.BenchmarkRuneCountTenASCIIChars 20000000 108 ns/op
utf8_test.BenchmarkRuneCountTenJapaneseChars 10000000 199 ns/op
utf8_test.BenchmarkEncodeASCIIRune 500000000 6 ns/op
utf8_test.BenchmarkEncodeJapaneseRune 100000000 10 ns/op
utf8_test.BenchmarkDecodeASCIIRune 100000000 13 ns/op
utf8_test.BenchmarkDecodeJapaneseRune 100000000 21 ns/op
R=gri
CC=golang-dev
https://golang.org/cl/161049
2009-11-25 13:30:30 -08:00
Rob Pike
773e77981d
rewrite RuneCountInString to use range.
...
R=gri
CC=golang-dev
https://golang.org/cl/160069
2009-11-25 11:39:34 -08:00
Nigel Tao
f65427a8be
Initial exp/draw/x11 implementation.
...
This provides an experimental X11 backend for the exp/draw interface.
It does not aim to provide a complete implementation of the X11 client protocol.
This works for me (Ubuntu Hardy 8.04, GOARCH=386). Your mileage my vary.
R=r, rsc, r1
CC=golang-dev
https://golang.org/cl/156109
2009-11-25 18:31:34 +11:00
Rob Pike
a0c55432f3
fix weird all.bash failures by running deps.bash before make clean runs in pkg directory.
...
before this change, if pkg/Make.deps is missing or broken, clean.bash fails and the build dies
but not until much later.
add freebsd to error message about valid values of $GOOS
TODO: would be nice if this process exited when an error occurred. subshells make it hard
R=rsc
CC=golang-dev
https://golang.org/cl/160065
2009-11-24 21:07:05 -08:00
Robert Griesemer
28f1914023
Handle presence of illegal semicolon after package clause better.
...
R=r, r1
https://golang.org/cl/157167
2009-11-24 17:34:08 -08:00
Robert Griesemer
a38ec58df0
Replace sort.Sort call with heapify algorithm in Init.
...
Fixed package comment.
Renamed some variables for symmetry, added more internal comments and more tests.
Fixes #304 .
R=rsc
https://golang.org/cl/157166
2009-11-24 17:20:13 -08:00
Ken Thompson
bd80b5a835
test case for large angles in trig functions
...
R=rsc
https://golang.org/cl/157160
2009-11-24 15:42:46 -08:00