]> Cypherpunks repositories - gostls13.git/log
gostls13.git
14 years agogoinstall: fix documentation typo
Fazlul Shahriar [Wed, 20 Oct 2010 23:47:02 +0000 (10:47 +1100)]
goinstall: fix documentation typo

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/2585043

14 years agobuild: add gobuilder and goplay to run.bash
Andrew Gerrand [Wed, 20 Oct 2010 23:46:10 +0000 (10:46 +1100)]
build: add gobuilder and goplay to run.bash
gobuilder: fix build to work with new log package

R=rsc
CC=golang-dev
https://golang.org/cl/2592041

14 years agoos: correct Stat S_ISDIR on Windows
Yasuhiro Matsumoto [Wed, 20 Oct 2010 23:29:45 +0000 (10:29 +1100)]
os: correct Stat S_ISDIR on Windows

R=rsc, brainman
CC=golang-dev
https://golang.org/cl/2598041

14 years ago5l: two stack split bugs in one day
Russ Cox [Wed, 20 Oct 2010 22:11:53 +0000 (18:11 -0400)]
5l: two stack split bugs in one day

An ARM expert could probably phrase the
comparison in fewer instructions, but this works.

R=ken2
CC=golang-dev
https://golang.org/cl/2620041

14 years agoencoding/hex: fix typo
Russ Cox [Wed, 20 Oct 2010 20:38:57 +0000 (16:38 -0400)]
encoding/hex: fix typo

Thanks to avadh4all for spotting it.

Fixes #1214.

R=r, r2
CC=golang-dev
https://golang.org/cl/2616041

14 years agogc: select receive with implicit conversion
Russ Cox [Wed, 20 Oct 2010 20:38:25 +0000 (16:38 -0400)]
gc: select receive with implicit conversion

Fixes #1172.

R=ken2
CC=golang-dev
https://golang.org/cl/2615041

14 years agocode gen error for *(complex)++
Ken Thompson [Wed, 20 Oct 2010 20:18:00 +0000 (13:18 -0700)]
code gen error for *(complex)++
includes array[i]++ and slice[i]++

R=rsc
CC=golang-dev
https://golang.org/cl/2614041

14 years agoruntime: don't let select split stack
Russ Cox [Wed, 20 Oct 2010 19:54:17 +0000 (15:54 -0400)]
runtime: don't let select split stack

Fixes #1209.

R=ken2
CC=golang-dev
https://golang.org/cl/2612041

14 years agoarm: fix typo in softfloat
Russ Cox [Wed, 20 Oct 2010 19:35:37 +0000 (15:35 -0400)]
arm: fix typo in softfloat

R=kaib
CC=golang-dev
https://golang.org/cl/2608041

14 years ago6l: correct logic for morestack choice
Russ Cox [Wed, 20 Oct 2010 19:16:39 +0000 (12:16 -0700)]
6l: correct logic for morestack choice

The frame that gets allocated is for both
the args and the autos.  If together they
exceed the default frame size, we need to
tell morestack about both so that it allocates
a large enough frame.

Sanity check stack pointer in morestack
to catch similar bugs.

R=ken2
CC=golang-dev
https://golang.org/cl/2609041

14 years agoarm: more tests pass
Russ Cox [Wed, 20 Oct 2010 15:43:27 +0000 (11:43 -0400)]
arm: more tests pass

R=ken2
CC=golang-dev
https://golang.org/cl/2606041

14 years agosyscall/arm: correct 64-bit system call arguments
Russ Cox [Wed, 20 Oct 2010 14:39:46 +0000 (10:39 -0400)]
syscall/arm: correct 64-bit system call arguments

Thanks to kaib for the tip.

R=ken2
CC=golang-dev
https://golang.org/cl/2596043

14 years ago6g: avoid too-large immediate constants
Russ Cox [Wed, 20 Oct 2010 04:40:06 +0000 (00:40 -0400)]
6g: avoid too-large immediate constants

R=ken2
CC=golang-dev
https://golang.org/cl/2566042

14 years agoreflect: add InterfaceValue.Get to enable setting of an interface
Rob Pike [Wed, 20 Oct 2010 04:25:28 +0000 (21:25 -0700)]
reflect: add InterfaceValue.Get to enable setting of an interface
value (through unsafe means) without having a reflect.Type
of type *interface{} (pointer to interface).  This is needed to make
gob able to handle interface values by a method analogous to
the way it handles maps.

R=rsc
CC=golang-dev
https://golang.org/cl/2597041

14 years agogob: break documentation into a separate doc.go file
Rob Pike [Wed, 20 Oct 2010 03:39:29 +0000 (20:39 -0700)]
gob: break documentation into a separate doc.go file

R=adg, r2
CC=golang-dev
https://golang.org/cl/2596041

14 years agohttp: do not close connection after sending HTTP/1.0 request
Russ Cox [Wed, 20 Oct 2010 03:29:25 +0000 (23:29 -0400)]
http: do not close connection after sending HTTP/1.0 request

Fixes #671.

R=adg, cw
CC=golang-dev
https://golang.org/cl/2431042

14 years ago8l: fix windows build
Alex Brainman [Wed, 20 Oct 2010 03:06:00 +0000 (14:06 +1100)]
8l: fix windows build

R=rsc
CC=golang-dev
https://golang.org/cl/2595041

14 years agoos: change TestForkExec so it can run on windows
Yasuhiro Matsumoto [Tue, 19 Oct 2010 22:46:24 +0000 (09:46 +1100)]
os: change TestForkExec so it can run on windows

R=brainman, vcc, Joe Poirier, rsc
CC=golang-dev
https://golang.org/cl/2530041

14 years agonntp: remove nntp package from the standard library.
Nigel Tao [Tue, 19 Oct 2010 22:43:27 +0000 (09:43 +1100)]
nntp: remove nntp package from the standard library.

R=adg
CC=golang-dev
https://golang.org/cl/2470045

14 years ago8l: fix references to INITDAT in windows pe.c
Russ Cox [Tue, 19 Oct 2010 22:17:07 +0000 (18:17 -0400)]
8l: fix references to INITDAT in windows pe.c

R=ken2
CC=golang-dev
https://golang.org/cl/2588041

14 years ago5l, 6l, 8l: link pclntab and symtab as ordinary rodata symbols
Russ Cox [Tue, 19 Oct 2010 22:07:19 +0000 (18:07 -0400)]
5l, 6l, 8l: link pclntab and symtab as ordinary rodata symbols

That is, move the pc/ln table and the symbol table
into the read-only data segment.  This eliminates
the need for a special load command to map the
symbol table into memory, which makes the
information available on systems that couldn't handle
the magic load to 0x99000000, like NaCl and ARM QEMU
and Linux without config_highmem=y.  It also
eliminates an #ifdef and some clumsy code to
find the symbol table on Windows.

The bad news is that the binary appears to be bigger
than it used to be.  This is not actually the case, though:
the same amount of data is being mapped into memory
as before, and the tables are still read-only, so they're
still shared across multiple instances of the binary as
they were before.  The difference is just that the tables
aren't squirreled away in some section that "size" doesn't
know to look at.

This is a checkpoint.
It probably breaks Windows and breaks NaCl more
than it used to be broken, but those will be fixed.
The logic involving -s needs to be revisited too.

Fixes #871.

R=ken2
CC=golang-dev
https://golang.org/cl/2587041

14 years ago5l, 6l, 8l: separate pass to fix addresses
Russ Cox [Tue, 19 Oct 2010 17:08:17 +0000 (13:08 -0400)]
5l, 6l, 8l: separate pass to fix addresses
Lay out code before data.

R=ken2
CC=golang-dev
https://golang.org/cl/2490043

14 years ago[68]l: expose genasmsym.
Luuk van Dijk [Tue, 19 Oct 2010 16:09:18 +0000 (18:09 +0200)]
[68]l: expose genasmsym.

R=rsc
CC=golang-dev
https://golang.org/cl/2512042

14 years agogoplay: fix to run under windows.
Yasuhiro Matsumoto [Tue, 19 Oct 2010 00:29:31 +0000 (11:29 +1100)]
goplay: fix to run under windows.

Fixes #1204.

R=golang-dev, brainman, Joe Poirier, alex.brainman, adg
CC=golang-dev, math-nuts
https://golang.org/cl/2532041

14 years agoA+C: Yasuhiro Matsumoto
Andrew Gerrand [Mon, 18 Oct 2010 23:20:32 +0000 (10:20 +1100)]
A+C: Yasuhiro Matsumoto

R=r, r2
CC=golang-dev
https://golang.org/cl/2543044

14 years agofix bug in example. need to convert Value to float in Abs example
Rob Pike [Mon, 18 Oct 2010 23:05:50 +0000 (16:05 -0700)]
fix bug in example. need to convert Value to float in Abs example

R=adg
CC=golang-dev
https://golang.org/cl/2486043

14 years agogc: update usage string in doc.go
Andrew Gerrand [Mon, 18 Oct 2010 22:26:11 +0000 (09:26 +1100)]
gc: update usage string in doc.go

R=rsc, r2, r
CC=golang-dev
https://golang.org/cl/2550041

14 years agonetchan: add new method Hangup to terminate transmission on a channel
Rob Pike [Mon, 18 Oct 2010 22:09:43 +0000 (15:09 -0700)]
netchan: add new method Hangup to terminate transmission on a channel
Fixes #1151.

R=rsc
CC=golang-dev
https://golang.org/cl/2469043

14 years agobig: add random number generation
Florian Uekermann [Mon, 18 Oct 2010 18:09:20 +0000 (14:09 -0400)]
big: add random number generation

Adds func (z *Int) RandIntn(src rand.Source,n *Int) *Int

R=rsc
CC=golang-dev, gri
https://golang.org/cl/2315045

14 years agoA+C: Florian Ukermann (individual CLA)
Russ Cox [Mon, 18 Oct 2010 18:02:24 +0000 (14:02 -0400)]
A+C: Florian Ukermann (individual CLA)

R=r, r2
CC=florian, golang-dev
https://golang.org/cl/2554042

14 years ago5l: handle jump to middle of floating point sequence
Russ Cox [Mon, 18 Oct 2010 17:44:39 +0000 (13:44 -0400)]
5l: handle jump to middle of floating point sequence

R=ken2
CC=golang-dev
https://golang.org/cl/2473042

14 years agoruntime: fix arm softfloat again for R12
Russ Cox [Mon, 18 Oct 2010 17:24:19 +0000 (13:24 -0400)]
runtime: fix arm softfloat again for R12

Missed a case, so now generalized.

R=ken2
CC=golang-dev
https://golang.org/cl/2540042

14 years agoruntime: fix amd64 build (broke by 386 support for Plan 9)
Russ Cox [Mon, 18 Oct 2010 17:01:10 +0000 (13:01 -0400)]
runtime: fix amd64 build (broke by 386 support for Plan 9)

TBR=r
CC=golang-dev
https://golang.org/cl/2556041

14 years ago8l, runtime: initial support for Plan 9
Yuval Pavel Zholkover [Mon, 18 Oct 2010 16:32:55 +0000 (12:32 -0400)]
8l, runtime: initial support for Plan 9

No multiple processes/locks, managed to compile
and run a hello.go (with print not fmt).  Also test/sieve.go
seems to run until 439 and stops with a
'throw: all goroutines are asleep - deadlock!'
- just like runtime/tiny.

based on Russ's suggestions at:
http://groups.google.com/group/comp.os.plan9/browse_thread/thread/cfda8b82535d2d68/243777a597ec1612

Build instructions:
cd src/pkg/runtime
make clean && GOOS=plan9 make install
this will build and install the runtime.

When linking with 8l, you should pass -s to suppress symbol
generation in the a.out, otherwise the generated executable will not run.

This is runtime only, the porting of the toolchain has already
been done: http://code.google.com/p/go-plan9/source/browse
in the plan9-quanstro branch.

R=rsc
CC=golang-dev
https://golang.org/cl/2273041

14 years agoruntime: update arm softfloat - no more R12
Russ Cox [Mon, 18 Oct 2010 16:24:59 +0000 (12:24 -0400)]
runtime: update arm softfloat - no more R12

R=ken2
CC=golang-dev
https://golang.org/cl/2555041

14 years agoA+C: Yuval Pavel Zholkover (individual CLA)
Russ Cox [Mon, 18 Oct 2010 16:01:59 +0000 (12:01 -0400)]
A+C: Yuval Pavel Zholkover (individual CLA)

R=r, r2
CC=golang-dev
https://golang.org/cl/2506045

14 years agogc: say that shift must be unsigned integer
Russ Cox [Mon, 18 Oct 2010 15:28:57 +0000 (11:28 -0400)]
gc: say that shift must be unsigned integer

R=ken2
CC=golang-dev
https://golang.org/cl/2519044

14 years ago5l: data-relocatable code layout
Russ Cox [Mon, 18 Oct 2010 15:09:59 +0000 (11:09 -0400)]
5l: data-relocatable code layout

R=ken2
CC=golang-dev
https://golang.org/cl/2479043

14 years ago[68]l: proper end of instruction ranges in dwarf.
Luuk van Dijk [Sun, 17 Oct 2010 20:35:55 +0000 (22:35 +0200)]
[68]l: proper end of instruction ranges in dwarf.

R=rsc
CC=golang-dev
https://golang.org/cl/2542042

14 years ago[68]l: fix off by one instruction in dwarf frame unwinding.
Luuk van Dijk [Sun, 17 Oct 2010 19:13:55 +0000 (21:13 +0200)]
[68]l: fix off by one instruction in dwarf frame unwinding.

R=rsc
CC=golang-dev
https://golang.org/cl/2543043

14 years agolog: update the documentation to clarify the behavior
Rob Pike [Sun, 17 Oct 2010 16:20:23 +0000 (09:20 -0700)]
log: update the documentation to clarify the behavior

R=rsc, PeterGo
CC=golang-dev
https://golang.org/cl/2519043

14 years ago5l: stop using R12 as SB
Russ Cox [Sun, 17 Oct 2010 15:41:23 +0000 (11:41 -0400)]
5l: stop using R12 as SB

Because the SB is only good for 8k and Go programs
tend to have much more data than that, SB doesn't
save very much.  A fmt.Printf-based hello world program
has  360 kB text segment.  Removing SB makes the text
500 bytes (0.14%) longer.

R=ken2, r2, ken3
CC=golang-dev
https://golang.org/cl/2487042

14 years ago8l: fix windows build.
Wei Guangjing [Sat, 16 Oct 2010 03:37:14 +0000 (23:37 -0400)]
8l: fix windows build.

R=rsc, brainman
CC=golang-dev
https://golang.org/cl/2543042

14 years ago8l: function at a time code layout
Russ Cox [Sat, 16 Oct 2010 00:19:57 +0000 (20:19 -0400)]
8l: function at a time code layout

R=ken2
CC=golang-dev
https://golang.org/cl/2481042

14 years agolog: roll back the rollback of the deprecation of the old interface.
Rob Pike [Fri, 15 Oct 2010 20:14:29 +0000 (13:14 -0700)]
log: roll back the rollback of the deprecation of the old interface.

R=adg
CC=golang-dev
https://golang.org/cl/2521042

14 years ago8l: blind attempt to fix windows build
Russ Cox [Fri, 15 Oct 2010 19:29:25 +0000 (15:29 -0400)]
8l: blind attempt to fix windows build
or at least gather more information

R=ken2
CC=golang-dev
https://golang.org/cl/2515042

14 years agogc: keep track of real actual type of identifiers.
Luuk van Dijk [Fri, 15 Oct 2010 19:25:34 +0000 (21:25 +0200)]
gc: keep track of real actual type of identifiers.

R=rsc
CC=golang-dev
https://golang.org/cl/2519042

14 years ago6l: function at a time code layout
Russ Cox [Fri, 15 Oct 2010 19:18:47 +0000 (15:18 -0400)]
6l: function at a time code layout

Also change the span-dependent jump algorithm
to use fewer iterations:

* resolve forward jumps at their targets (comefrom list)
* mark jumps as small or big and only do small->big
* record whether a jump failed to be encodable

These changes mean that a function with only small
jumps can be laid out in a single iteration, and the
vast majority of functions take just two iterations.
I was seeing a maximum of 5 iterations before; the
max now is 3 and there are fewer that get even that far.

R=ken2
CC=golang-dev
https://golang.org/cl/2537041

14 years ago6l, 8l: avoid recursion in asmandsz
Russ Cox [Fri, 15 Oct 2010 17:01:03 +0000 (13:01 -0400)]
6l, 8l: avoid recursion in asmandsz

The old code said

if(x) {
handle a
return
}
aa = *a
rewrite aa to make x true
recursivecall(&aa)

The new code says

params = copy out of a
if(!x) {
rewrite params to make x true
}
handle params

but it's hard to see that in the Rietveld diffs because
it gets confused by changes in indentation.

Avoiding the recursion makes other changes easier.

R=ken2
CC=golang-dev
https://golang.org/cl/2533041

14 years ago5l, 6l, 8l: accumulate data image during import
Russ Cox [Fri, 15 Oct 2010 03:48:40 +0000 (23:48 -0400)]
5l, 6l, 8l: accumulate data image during import

Using explicit relocations internally, we can
represent the data for a particular symbol as
an initialized block of memory instead of a
linked list of ADATA instructions.  The real
goal here is to be able to hand off some of the
relocations to the dynamic linker when interacting
with system libraries, but a pleasant side effect is
that the memory image is much more compact
than the ADATA list, so the linkers use less memory.

R=ken2
CC=golang-dev
https://golang.org/cl/2512041

14 years agotag release.2010-10-13.1
Andrew Gerrand [Fri, 15 Oct 2010 01:06:34 +0000 (12:06 +1100)]
tag release.2010-10-13.1

R=r
CC=golang-dev
https://golang.org/cl/2526041

14 years agorelease.2010-10-13.1 weekly.2010-10-13.1
Andrew Gerrand [Fri, 15 Oct 2010 01:05:05 +0000 (12:05 +1100)]
release.2010-10-13.1

R=r, r2
CC=golang-dev
https://golang.org/cl/2493043

14 years agolog: roll back deprecation of old API to apply fix to log.Output in public release.
Rob Pike [Fri, 15 Oct 2010 01:02:08 +0000 (18:02 -0700)]
log: roll back deprecation of old API to apply fix to log.Output in public release.

R=adg
CC=golang-dev
https://golang.org/cl/2525042

14 years agolog: fix custom output bug
Andrew Gerrand [Fri, 15 Oct 2010 00:55:51 +0000 (11:55 +1100)]
log: fix custom output bug

R=r
CC=golang-dev
https://golang.org/cl/2525041

14 years agoarm: enable 6 more tests after net fix
Russ Cox [Thu, 14 Oct 2010 21:15:45 +0000 (17:15 -0400)]
arm: enable 6 more tests after net fix

R=ken2
CC=golang-dev
https://golang.org/cl/2520042

14 years agosyscall: fix arm networking
Russ Cox [Thu, 14 Oct 2010 20:13:44 +0000 (16:13 -0400)]
syscall: fix arm networking

Suggested by fango (fan.howard@gmail.com)

R=r, r2
CC=golang-dev
https://golang.org/cl/2514041

14 years agolog: delete deprecated functionality
Rob Pike [Thu, 14 Oct 2010 19:50:36 +0000 (12:50 -0700)]
log: delete deprecated functionality
Fixes #1195.

R=rsc
CC=golang-dev
https://golang.org/cl/2504043

14 years agoarm: adjust recover for new reflect.call
Russ Cox [Thu, 14 Oct 2010 14:45:32 +0000 (10:45 -0400)]
arm: adjust recover for new reflect.call

R=ken2
CC=golang-dev
https://golang.org/cl/2471043

14 years agodoc: add The Expressiveness of Go talk to docs.html
Andrew Gerrand [Thu, 14 Oct 2010 06:25:23 +0000 (17:25 +1100)]
doc: add The Expressiveness of Go talk to docs.html

R=r, r2
CC=golang-dev
https://golang.org/cl/2494042

14 years agotag release.2010-10-13
Andrew Gerrand [Thu, 14 Oct 2010 03:56:11 +0000 (14:56 +1100)]
tag release.2010-10-13

R=stephenm
CC=golang-dev
https://golang.org/cl/2471042

14 years agorelease.2010-10-13 weekly.2010-10-13
Andrew Gerrand [Thu, 14 Oct 2010 03:52:08 +0000 (14:52 +1100)]
release.2010-10-13

R=r, rsc, r2
CC=golang-dev
https://golang.org/cl/2499041

14 years agomisc: add goplay
Andrew Gerrand [Thu, 14 Oct 2010 03:06:02 +0000 (14:06 +1100)]
misc: add goplay

R=rsc, r
CC=golang-dev
https://golang.org/cl/2473041

14 years agosmtp: new package
Evan Shaw [Thu, 14 Oct 2010 02:07:28 +0000 (22:07 -0400)]
smtp: new package

R=rsc, iant, agl
CC=golang-dev
https://golang.org/cl/2052042

14 years agobufio: bulletproof UnreadRune
Rob Pike [Thu, 14 Oct 2010 00:12:43 +0000 (17:12 -0700)]
bufio: bulletproof UnreadRune
After a fill(), there is nothing to back up.  Make sure UnreadRune
recognizes the situation.

Fixes #1137.
(Stops the crash, but doesn't make UnreadRune usable after a Peek()).

R=rsc
CC=golang-dev
https://golang.org/cl/2498041

14 years agoarm: enable 8 more packages
Russ Cox [Wed, 13 Oct 2010 22:16:44 +0000 (18:16 -0400)]
arm: enable 8 more packages

The remaining failures include:

* something about bit operations?
crypto/block
encoding/binary

* something about file I/O?
archive/tar
archive/zip
debug/dwarf
debug/elf
debug/macho
image/png

* floating point
cmath
expvar
flag
fmt
gob
json
math
strconv
template
xml

* network (maybe fixed by a pending CL)
http
netchan
rpc
rpc/jsonrpc
syslog
websocket

* line numbers
log

* haven't bothered / not sure
exp/datafmt
exp/eval
go/printer
os
os/signal
testing/quick

R=ken2
CC=golang-dev
https://golang.org/cl/2496041

14 years agofix arm bug in reflect.call
Ken Thompson [Wed, 13 Oct 2010 20:24:14 +0000 (13:24 -0700)]
fix arm bug in reflect.call

R=rsc
CC=golang-dev
https://golang.org/cl/2475042

14 years agovarious: avoid %ld etc
Russ Cox [Wed, 13 Oct 2010 20:20:22 +0000 (16:20 -0400)]
various: avoid %ld etc

The Plan 9 tools assume that long is 32 bits.
We converted all instances of long to int32 when
importing the code but missed the print formats.
Because int32 is always int on the compilers we use,
it is never correct to use %lux, %ld, etc.  Convert to %ux, %d, etc.

(It matters because on 64-bit gcc, long is 64 bits,
so we were printing 32-bit quantities with 64-bit formats.)

R=ken2
CC=golang-dev
https://golang.org/cl/2491041

14 years ago5l, 6l, 8l: first pass cleanup
Russ Cox [Wed, 13 Oct 2010 19:51:21 +0000 (15:51 -0400)]
5l, 6l, 8l: first pass cleanup

* Maintain Sym* list for text with individual
  prog lists instead of using one huge list and
  overloading p->pcond.
* Comment what each file is for.
* Move some output code from span.c to asm.c.
* Move profiling into prof.c, symbol table into symtab.c.
* Move mkfwd to ld/lib.c.
* Throw away dhog dynamic loading code.
* Throw away Alef become.
* Fix printing of WORD instructions in 5l -a.

Goal here is to be able to handle each piece of text or data
as a separate piece, both to make it easier to load the
occasional .o file and also to make it possible to split the
work across multiple threads.

R=ken2, r, ken3
CC=golang-dev
https://golang.org/cl/2335043

14 years ago5l, 6l, 8l: indent, outdent
Russ Cox [Wed, 13 Oct 2010 19:19:53 +0000 (15:19 -0400)]
5l, 6l, 8l: indent, outdent

This is entirely adding and removing tabs.
It looks weird but will make the diffs for the
next change easier to read.

R=ken2
CC=golang-dev
https://golang.org/cl/2490041

14 years agolog: fix out-of-date package comment
Rob Pike [Wed, 13 Oct 2010 18:05:45 +0000 (11:05 -0700)]
log: fix out-of-date package comment

R=rsc
CC=golang-dev
https://golang.org/cl/2485041

14 years agoruntime: remove done TODO from SetFinalizer
Andrew Gerrand [Wed, 13 Oct 2010 03:40:02 +0000 (14:40 +1100)]
runtime: remove done TODO from SetFinalizer

R=rsc
CC=golang-dev
https://golang.org/cl/2472041

14 years agoimage: add an offset to Tiled.
Nigel Tao [Wed, 13 Oct 2010 01:05:21 +0000 (12:05 +1100)]
image: add an offset to Tiled.

R=r, r2
CC=golang-dev
https://golang.org/cl/2469041

14 years agolog: reduce allocations
Rob Pike [Wed, 13 Oct 2010 00:27:14 +0000 (17:27 -0700)]
log: reduce allocations
Use a bytes.Buffer in log writing instead of string concatenation.
Should reduce the number of allocations significantly.

R=rsc, r2
CC=golang-dev
https://golang.org/cl/2417042

14 years agoEffective Go: update examples to use new logging interface.
Rob Pike [Tue, 12 Oct 2010 23:56:50 +0000 (16:56 -0700)]
Effective Go: update examples to use new logging interface.

R=adg
CC=golang-dev
https://golang.org/cl/2468041

14 years agodoc: add Sydney University video, fix hlint warnings
Andrew Gerrand [Tue, 12 Oct 2010 22:15:28 +0000 (09:15 +1100)]
doc: add Sydney University video, fix hlint warnings

R=r, r2, rsc, uriel
CC=golang-dev
https://golang.org/cl/2433042

14 years agonetchan: export before import when testing.
Roger Peppe [Tue, 12 Oct 2010 22:05:53 +0000 (15:05 -0700)]
netchan: export before import when testing.
Fixes some race conditions.

R=r
CC=golang-dev
https://golang.org/cl/2456041

14 years ago6l: work with OS X nm/otool
Jim McGrath [Tue, 12 Oct 2010 20:52:17 +0000 (16:52 -0400)]
6l: work with OS X nm/otool

6l was skipping emitting the (2 byte) symbol table if there were no imported or exported
symbols. You can't just drop the symbol table entirely - the linker dies if you have
a linkedit section but no table. You can omit the linkedit section or both the linkedit
and the dlyd parts in the right circumstances, but that seems much more risky to me.

R=rsc
CC=golang-dev
https://golang.org/cl/2421042

14 years agolog: new interface
Rob Pike [Tue, 12 Oct 2010 19:59:18 +0000 (12:59 -0700)]
log: new interface

New logging interface simplifies and generalizes.

1) Loggers now have only one output.
2) log.Stdout, Stderr, Crash and friends are gone.
Logging is now always to standard error by default.
3) log.Panic* replaces log.Crash*.
4) Exiting and panicking are not part of the logger's state; instead
the functions Exit* and Panic* simply call Exit or panic after
printing.
5) There is now one 'standard logger'.  Instead of calling Stderr,
use Print etc.  There are now triples, by analogy with fmt:
Print, Println, Printf
What was log.Stderr is now best represented by log.Println,
since there are now separate Print and Println functions
(and methods).
6) New functions SetOutput, SetFlags, and SetPrefix allow global
editing of the standard logger's properties.   This is new
functionality. For instance, one can call
log.SetFlags(log.Lshortfile|log.Ltime|log.Lmicroseconds)
to get all logging output to show file name, line number, and
time stamp.

In short, for most purposes
log.Stderr -> log.Println or log.Print
log.Stderrf -> log.Printf
log.Crash -> log.Panicln or log.Panic
log.Crashf -> log.Panicf
log.Exit -> log.Exitln or log.Exit
log.Exitf -> log.Exitf (no change)

This has a slight breakage: since loggers now write only to one
output, existing calls to log.New() need to delete the second argument.
Also, custom loggers with exit or panic properties will need to be
reworked.

All package code updated to new interface.

The test has been reworked somewhat.

The old interface will be removed after the new release.
For now, its elements are marked 'deprecated' in their comments.

Fixes #1184.

R=rsc
CC=golang-dev
https://golang.org/cl/2419042

14 years agoarm: fix syscall build again
Russ Cox [Tue, 12 Oct 2010 19:16:47 +0000 (15:16 -0400)]
arm: fix syscall build again

R=ken2
CC=golang-dev
https://golang.org/cl/2465041

14 years agoarm: regenerate ztypes_linux_arm.go (fix build)
Russ Cox [Tue, 12 Oct 2010 14:24:55 +0000 (10:24 -0400)]
arm: regenerate ztypes_linux_arm.go (fix build)

R=adg
CC=golang-dev
https://golang.org/cl/2404043

14 years agosyscall: add sockaddr_ll support for linux/386, linux/amd64
Mikio Hara [Tue, 12 Oct 2010 13:48:56 +0000 (09:48 -0400)]
syscall: add sockaddr_ll support for linux/386, linux/amd64

R=rsc, albert.strasheim
CC=golang-dev
https://golang.org/cl/2356042

14 years agosyscall: implement WaitStatus and Wait4() for windows
Wei Guangjing [Tue, 12 Oct 2010 04:42:07 +0000 (15:42 +1100)]
syscall: implement WaitStatus and Wait4() for windows

R=brainman, rsc, kardia, Joe Poirier
CC=golang-dev
https://golang.org/cl/1910041

14 years agoarm: fix build
Russ Cox [Tue, 12 Oct 2010 03:58:51 +0000 (23:58 -0400)]
arm: fix build

Effectively reverts https://code.google.com/p/go/source/detail?r=8c52477401ad
Should make ARM build pass again, but untested.
Probably still bugs involving reflect.call somewhere.

R=ken2
CC=golang-dev
https://golang.org/cl/2416042

14 years agoimage: another build fix regarding ColorImage.
Nigel Tao [Tue, 12 Oct 2010 03:33:37 +0000 (14:33 +1100)]
image: another build fix regarding ColorImage.

R=adg
TBR=adg
CC=golang-dev
https://golang.org/cl/2449041

14 years agoexp/draw: unbreak build.
Nigel Tao [Tue, 12 Oct 2010 03:05:50 +0000 (14:05 +1100)]
exp/draw: unbreak build.

R=adg
CC=golang-dev
https://golang.org/cl/2448041

14 years agoimage: add image.Tiled type, the Go equivalent of Plan9's repl bit.
Nigel Tao [Tue, 12 Oct 2010 02:44:11 +0000 (13:44 +1100)]
image: add image.Tiled type, the Go equivalent of Plan9's repl bit.
Make ColorImage methods' receiver type be a pointer.

R=r, rsc
CC=golang-dev
https://golang.org/cl/2345043

14 years agoMake.cmd: remove $(OFILES)
Eric Clark [Tue, 12 Oct 2010 02:39:37 +0000 (22:39 -0400)]
Make.cmd: remove $(OFILES)

The linker doesn't support multiple object files (maybe it did in the past?)

R=rsc
CC=golang-dev
https://golang.org/cl/2444041

14 years agoexp/iterable: delete
Russ Cox [Tue, 12 Oct 2010 02:38:42 +0000 (22:38 -0400)]
exp/iterable: delete

Package iterable has outlived its utility.

It is an interesting demonstration, but it encourages
people to use iteration over channels where simple
iteration over array indices or a linked list would be
cheaper, simpler, and have fewer races.

R=dsymonds, r
CC=golang-dev
https://golang.org/cl/2436041

14 years agobuild: fix darwin/386 build
Andrew Gerrand [Tue, 12 Oct 2010 00:49:05 +0000 (11:49 +1100)]
build: fix darwin/386 build

R=rsc
CC=golang-dev
https://golang.org/cl/2443041

14 years agold: be less picky about bad line number info
Russ Cox [Mon, 11 Oct 2010 20:21:03 +0000 (16:21 -0400)]
ld: be less picky about bad line number info

Fixes #1175.

R=lvd
CC=golang-dev
https://golang.org/cl/2439041

14 years agonew command gotry.
Rob Pike [Mon, 11 Oct 2010 19:40:13 +0000 (12:40 -0700)]
new command gotry.
An exercise in reflection and an unusual tool.

From the usage message:

usage: gotry [packagedirectory] expression ...
Given one expression, gotry attempts to evaluate that expression.
Given multiple expressions, gotry treats them as a list of arguments
and result values and attempts to find a function in the package
that, given the first few expressions as arguments, evaluates to
the remaining expressions as results.  If the first expression has
methods, it will also search for applicable methods.

If there are multiple expressions, a package directory must be
specified. If there is a package argument, the expressions are
evaluated in an environment that includes
import . "packagedirectory"

Examples:
gotry 3+4
# evaluates to 7
gotry strings '"abc"' '"c"' 7-5
# finds strings.Index etc.
gotry regexp 'MustCompile("^[0-9]+")' '"12345"' true
# finds Regexp.MatchString

R=rsc, PeterGo, r2
CC=golang-dev
https://golang.org/cl/2352043

14 years agonetchan: zero out request to ensure correct gob decoding.
Roger Peppe [Mon, 11 Oct 2010 19:36:16 +0000 (12:36 -0700)]
netchan: zero out request to ensure correct gob decoding.
Gob decoding does not overwrite fields which are zero
in the encoder.
Fixes #1174.

R=r, r2
CC=golang-dev
https://golang.org/cl/2337044

14 years ago6l: correct offset for __nl_symbol_ptr in Mach-O.
Jim McGrath [Mon, 11 Oct 2010 18:45:01 +0000 (14:45 -0400)]
6l: correct offset for __nl_symbol_ptr in Mach-O.

Fixes malformed object message from nm etc.
Fixes #1180.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/2390042

14 years ago6l: fix Mach-O LC_RPATH
Jim McGrath [Mon, 11 Oct 2010 18:39:41 +0000 (14:39 -0400)]
6l: fix Mach-O LC_RPATH

Fixes #1177.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/2387042

14 years agoA+C: Jim McGrath (individual CLA)
Russ Cox [Mon, 11 Oct 2010 18:32:25 +0000 (14:32 -0400)]
A+C: Jim McGrath (individual CLA)

R=r, r2
CC=golang-dev
https://golang.org/cl/2438041

14 years agoexpvar: add (*Int).Set
Sam Thorogood [Mon, 11 Oct 2010 17:14:07 +0000 (13:14 -0400)]
expvar: add (*Int).Set

R=golang-dev, adg, rsc
CC=golang-dev
https://golang.org/cl/2336044

14 years agoCONTRIBUTORS: link sam.thorogood@gmail.com for code review
Russ Cox [Mon, 11 Oct 2010 17:13:57 +0000 (13:13 -0400)]
CONTRIBUTORS: link sam.thorogood@gmail.com for code review

R=Sam
CC=golang-dev
https://golang.org/cl/2437041

14 years ago crypto/tls: make SetReadTimeout work.
Adam Langley [Mon, 11 Oct 2010 14:41:01 +0000 (10:41 -0400)]
crypto/tls: make SetReadTimeout work.

        Fixes #1181.

R=rsc, agl1, cw, r2
CC=golang-dev
https://golang.org/cl/2414041

14 years ago crypto/tls: better error messages for certificate issues.
Adam Langley [Mon, 11 Oct 2010 14:39:56 +0000 (10:39 -0400)]
crypto/tls: better error messages for certificate issues.

        Fixes #1146.

R=rsc, agl1
CC=golang-dev
https://golang.org/cl/2380042

14 years agotime: add After
Andrew Gerrand [Mon, 11 Oct 2010 02:45:26 +0000 (13:45 +1100)]
time: add After

Permits one to easily put a timeout in a select:

select {
case <-ch:
// foo
case <-time.After(1e6):
// bar
}

R=r, rog, rsc, sameer1, PeterGo, iant, nigeltao_gnome
CC=golang-dev
https://golang.org/cl/2321043