]> Cypherpunks repositories - gostls13.git/log
gostls13.git
14 years agogo spec: follow-up cleanups after communication operator changes
Robert Griesemer [Tue, 1 Feb 2011 20:02:49 +0000 (12:02 -0800)]
go spec: follow-up cleanups after communication operator changes

These are syntactical changes to better reflect the communication
operator's new status in the language.

- sending to a channel is now done via a send statement
- there is no binary communication operation anymore which
  leads to a reduction of the number of precedence levels
  from 6 to 5 (yeah!)
- small semantic change: since a send operation is not part
  of the expression syntax anymore, a <- send operator is
  binding weaker than any other operator now
- receiving from a channel is done as before via the unary
  receive expression
- communication clauses in select statement now can contain
  send statements or receive expressions

R=rsc, r, iant, ken2, gri1
CC=golang-dev
https://golang.org/cl/3973051

14 years agocodereview: more ascii vs unicode nonsense
Russ Cox [Tue, 1 Feb 2011 19:17:41 +0000 (14:17 -0500)]
codereview: more ascii vs unicode nonsense

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

14 years agogc: handle invalid name in type switch
Russ Cox [Tue, 1 Feb 2011 19:00:36 +0000 (14:00 -0500)]
gc: handle invalid name in type switch

Fixes #1453.

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

14 years agohttp: add host patterns
Jose Luis Vázquez González [Tue, 1 Feb 2011 18:58:59 +0000 (13:58 -0500)]
http: add host patterns

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

14 years agoA+C: Jose Luis Vázquez González (individual CLA)
Russ Cox [Tue, 1 Feb 2011 18:31:28 +0000 (13:31 -0500)]
A+C: Jose Luis Vázquez González (individual CLA)

R=gri, josvazg, gri1
CC=golang-dev
https://golang.org/cl/4044047

14 years agostrconv: add test that trips up other implementations
Russ Cox [Tue, 1 Feb 2011 17:48:18 +0000 (12:48 -0500)]
strconv: add test that trips up other implementations

R=r, gri1
CC=golang-dev
https://golang.org/cl/4092045

14 years agoexec: use custom error for LookPath
Gustavo Niemeyer [Tue, 1 Feb 2011 17:12:51 +0000 (12:12 -0500)]
exec: use custom error for LookPath

Make the error message and the needed action more obvious
when a command isn't found to obtain the source code
of a project.  Users seem to strugle with the existing
wording in practice.

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

14 years ago6g: fix registerization of temporaries
Eoghan Sherry [Tue, 1 Feb 2011 17:12:42 +0000 (12:12 -0500)]
6g: fix registerization of temporaries

Use correct range in allocated register test.

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

14 years ago6l: add comment to CMOV* relocation
Gustavo Niemeyer [Tue, 1 Feb 2011 16:49:33 +0000 (11:49 -0500)]
6l: add comment to CMOV* relocation

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

14 years agowindows: multiple improvements and cleanups
Hector Chu [Tue, 1 Feb 2011 16:49:24 +0000 (11:49 -0500)]
windows: multiple improvements and cleanups

The callback mechanism has been made more flexible.
Eliminated one round of argument copying in Syscall.
Faster Get/SetLastError implemented.
Added gettime for gc perf profiling.

R=rsc, brainman, mattn, rog
CC=golang-dev
https://golang.org/cl/4058046

14 years agocrypto: add package.
Adam Langley [Tue, 1 Feb 2011 16:02:48 +0000 (11:02 -0500)]
crypto: add package.

The crypto package is added as a common place to store identifiers for
hash functions. At the moment, the rsa package has an enumeration of
hash functions and knowledge of their digest lengths. This is an
unfortunate coupling and other high level crypto packages tend to need
to duplicate this enumeration and knowledge (i.e. openpgp).

crypto pulls this code out into a common location.

It would also make sense to add similar support for ciphers to crypto,
but the problem there isn't as acute that isn't done in this change.

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

14 years agosyscall: add network interface constants for freebsd/386, freebsd/amd64
Mikio Hara [Tue, 1 Feb 2011 13:46:21 +0000 (08:46 -0500)]
syscall: add network interface constants for freebsd/386, freebsd/amd64

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

14 years agocgo: define CGO_CFLAGS and CGO_LDFLAGS in Go files
Gustavo Niemeyer [Tue, 1 Feb 2011 13:44:18 +0000 (08:44 -0500)]
cgo: define CGO_CFLAGS and CGO_LDFLAGS in Go files

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

14 years agogc: fix send precedence
Russ Cox [Tue, 1 Feb 2011 13:29:21 +0000 (08:29 -0500)]
gc: fix send precedence

Test and fix case found by Robert.
Add receive inside send to tree too.

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

14 years agomisc/vim: Define import commands on buffer switch
Gustavo Niemeyer [Tue, 1 Feb 2011 00:12:57 +0000 (11:12 +1100)]
misc/vim: Define import commands on buffer switch

This change fixes the import plugin so that the
defined commands are available when opening a new
Go buffer from within Vim itself.

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

14 years agomisc/vim: Document better syntax sync parameter
Gustavo Niemeyer [Tue, 1 Feb 2011 00:12:45 +0000 (11:12 +1100)]
misc/vim: Document better syntax sync parameter

Forcing the synchronization of 500 lines is both slower and
less precise than searching for a known sync point.
Unfortunately, though, the way to synchronize correctly is
using the grouphere instruction, which has a bug.

I've already proposed the fix to Vim, so future releases
should have this working.  We can continue using the 500 lines
syncing for now.

This change just documents the proper way to sync.

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

14 years agogc: remove non-blocking send, receive syntax
Russ Cox [Mon, 31 Jan 2011 23:52:16 +0000 (18:52 -0500)]
gc: remove non-blocking send, receive syntax

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

14 years agoreplace non-blocking send, receive syntax with select
Russ Cox [Mon, 31 Jan 2011 23:36:28 +0000 (18:36 -0500)]
replace non-blocking send, receive syntax with select

R=golang-dev, nigeltao, niemeyer, r
CC=golang-dev
https://golang.org/cl/4079053

14 years agounicode: update to unicode 6.0.0
Rob Pike [Mon, 31 Jan 2011 23:20:44 +0000 (15:20 -0800)]
unicode: update to unicode 6.0.0

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

14 years agoebnflint: exit with non-zero status on error
Russ Cox [Mon, 31 Jan 2011 22:42:10 +0000 (17:42 -0500)]
ebnflint: exit with non-zero status on error

Tweak spec to avoid ebnflint complaints.

R=gri
CC=golang-dev
https://golang.org/cl/3973050

14 years agodoc/progs: make sure all programs compile and run
Rob Pike [Mon, 31 Jan 2011 22:41:36 +0000 (14:41 -0800)]
doc/progs: make sure all programs compile and run

Fixes #1455.

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

14 years ago.hgignore: Add some more files created by all.bash.
Ian Lance Taylor [Mon, 31 Jan 2011 21:21:44 +0000 (13:21 -0800)]
.hgignore: Add some more files created by all.bash.

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

14 years agosuffixarray: fix construction bug
Eric Eisner [Mon, 31 Jan 2011 21:13:02 +0000 (13:13 -0800)]
suffixarray: fix construction bug

Previously, group numbers were updated while being read,
sometimes leading to inconsistencies.

R=gri, gri1
CC=golang-dev
https://golang.org/cl/4121045

14 years agoeffective go: remove non-blocking ops in leaky bucket example
Rob Pike [Mon, 31 Jan 2011 20:46:38 +0000 (12:46 -0800)]
effective go: remove non-blocking ops in leaky bucket example

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

14 years agoos: add ETIMEDOUT
Albert Strasheim [Mon, 31 Jan 2011 19:54:58 +0000 (14:54 -0500)]
os: add ETIMEDOUT

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

14 years agocgo: improve error reporting slightly.
Roger Peppe [Mon, 31 Jan 2011 19:31:34 +0000 (14:31 -0500)]
cgo: improve error reporting slightly.
If there were warnings or errors in the user code,
cgo would print the first error from gcc and then stop,
which is not helpful.
This CL makes cgo ignore errors from user code
in the first pass - they will be shown later.
It also prints errors from user preamble code
with the correct line numbers.
(Also fixed misleading usage message).

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

14 years agosyscall: add network interface constants for darwin/386, darwin/amd64
Mikio Hara [Mon, 31 Jan 2011 17:50:50 +0000 (12:50 -0500)]
syscall: add network interface constants for darwin/386, darwin/amd64

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

14 years agolib9: update to Unicode 6.0.0
Russ Cox [Mon, 31 Jan 2011 17:38:54 +0000 (12:38 -0500)]
lib9: update to Unicode 6.0.0

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

14 years agounicode: build maketables during build, take 2
Russ Cox [Mon, 31 Jan 2011 16:50:04 +0000 (11:50 -0500)]
unicode: build maketables during build, take 2

The "all:" target is the default for running gomake
by hand, but it is not used during the build.
The build runs make install and make test.

Save the build of maketables for the test phase
so that the packages it needs will have been
installed already.

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

14 years agoruntime: generate Go defs for C types.
Luuk van Dijk [Mon, 31 Jan 2011 11:27:28 +0000 (12:27 +0100)]
runtime: generate Go defs for C types.

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

14 years agobufio: make Flush a no-op when the buffer is empty
Andrew Gerrand [Mon, 31 Jan 2011 07:54:25 +0000 (18:54 +1100)]
bufio: make Flush a no-op when the buffer is empty

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

14 years agorun.bash: disable doc/codelab/wiki test on windows
Alex Brainman [Mon, 31 Jan 2011 04:58:44 +0000 (15:58 +1100)]
run.bash: disable doc/codelab/wiki test on windows

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

14 years agoenable arm peep.
Ken Thompson [Sun, 30 Jan 2011 23:55:08 +0000 (15:55 -0800)]
enable arm peep.
one bug fixed,
probably more will be revealed

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

14 years agounicode: add maketables to build, fix build
Russ Cox [Sun, 30 Jan 2011 21:09:16 +0000 (16:09 -0500)]
unicode: add maketables to build, fix build

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

14 years agogc: special case code for single-op blocking and non-blocking selects
Russ Cox [Sun, 30 Jan 2011 21:07:57 +0000 (16:07 -0500)]
gc: special case code for single-op blocking and non-blocking selects

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

14 years agotest: another select test
Russ Cox [Sun, 30 Jan 2011 20:46:02 +0000 (15:46 -0500)]
test: another select test

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

14 years agosync: a couple of documentation nits.
Rob Pike [Sat, 29 Jan 2011 22:56:15 +0000 (14:56 -0800)]
sync: a couple of documentation nits.

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

14 years ago8l/6l: pe fixes
Alex Brainman [Sat, 29 Jan 2011 12:13:40 +0000 (23:13 +1100)]
8l/6l: pe fixes

- fixed length of amd64 .data pe section
  (don't need to include non-initialised data)

- use correct oh/oh64 variable when updating
  data directory in addexports

- simplify and cleanup

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

14 years agoruntime/cgo: fix cross-compiling windows packages
Alex Brainman [Sat, 29 Jan 2011 11:57:19 +0000 (22:57 +1100)]
runtime/cgo: fix cross-compiling windows packages

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

14 years agofix windows build
Wei Guangjing [Sat, 29 Jan 2011 04:44:37 +0000 (23:44 -0500)]
fix windows build

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

14 years agotime: Support Solaris zoneinfo directory.
Ian Lance Taylor [Fri, 28 Jan 2011 23:56:14 +0000 (15:56 -0800)]
time: Support Solaris zoneinfo directory.

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

14 years agoruntime: select bug
Russ Cox [Fri, 28 Jan 2011 22:17:38 +0000 (17:17 -0500)]
runtime: select bug

The sanity checking in pass 2 is wrong
when a select is offering to communicate in
either direction on a channel and neither case
is immediately ready.

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

14 years agoruntime: simpler heap map, memory allocation
Russ Cox [Fri, 28 Jan 2011 20:03:26 +0000 (15:03 -0500)]
runtime: simpler heap map, memory allocation

The old heap maps used a multilevel table, but that
was overkill: there are only 1M entries on a 32-bit
machine and we can arrange to use a dense address
range on a 64-bit machine.

The heap map is in bss.  The assumption is that if
we don't touch the pages they won't be mapped in.

Also moved some duplicated memory allocation
code out of the OS-specific files.

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

14 years agogob: fix build
Rob Pike [Fri, 28 Jan 2011 19:07:12 +0000 (11:07 -0800)]
gob: fix build
delete reference to Debug function.

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

14 years agogob: make nested interfaces work.
Rob Pike [Fri, 28 Jan 2011 18:53:42 +0000 (10:53 -0800)]
gob: make nested interfaces work.
Also clean up the code, make it more regular.

Fixes #1416.

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

14 years agogob: updates to the debugging tool.
Rob Pike [Fri, 28 Jan 2011 18:53:06 +0000 (10:53 -0800)]
gob: updates to the debugging tool.
- complex numbers now supported.
- entirely independent of standard decode code.
- parser has no read-ahead; that is, the scanning works
simply by reading the values as they arrive, not by trying
to count bytes for message boundaries, a proof of concept
for the pending rewrite of the regular decoder.

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

14 years agodoc/codelab/wiki: fixes
Russ Cox [Fri, 28 Jan 2011 14:42:51 +0000 (09:42 -0500)]
doc/codelab/wiki: fixes

make test.sh runnable as a command.
announce only on 127.0.0.1.
rebuild final-test.bin when final-test.go changes.

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

14 years agogodoc: tiny bug fix - use correct filename when comparing files against the index...
Robert Griesemer [Thu, 27 Jan 2011 22:11:58 +0000 (14:11 -0800)]
godoc: tiny bug fix - use correct filename when comparing files against the index whitelist

This bug prevented files such as READMEs etc. from being included in the index.
For instance, now author names recorded in the AUTHORS file can be found with
a godoc query.

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

14 years agobytes: Add Buffer.ReadBytes, Buffer.ReadString
Evan Shaw [Thu, 27 Jan 2011 22:00:31 +0000 (14:00 -0800)]
bytes: Add Buffer.ReadBytes, Buffer.ReadString

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

14 years agospec: remove non-blocking channel operators
Russ Cox [Thu, 27 Jan 2011 20:34:28 +0000 (15:34 -0500)]
spec: remove non-blocking channel operators

Add intended changes for close + closed, commented out.

R=golang-dev, niemeyer, r, gri1
CC=golang-dev
https://golang.org/cl/4013045

14 years ago6l: Relocate CMOV* instructions
Gustavo Niemeyer [Thu, 27 Jan 2011 19:09:03 +0000 (14:09 -0500)]
6l: Relocate CMOV* instructions

The linker avoids a GOT indirection by turning a MOV into
a LEA, but with x86-64 GCC has started emitting CMOV*
instructions which break the existing logic.

This will generate errors such as:

  unexpected GOT reloc for non-dynamic symbol luaO_nilobject_

The CMOV* instructions may be emitted with normal code like:

  if (o >= L->top) return cast(TValue *, luaO_nilobject);
  else return o;

Which gets compiled into (relocation offset at 1b):

  13: 48 3b 47 10             cmp    0x10(%rdi),%rax
  17: 48 0f 43 05 00 00 00    cmovae 0x0(%rip),%rax
  1e: 00

This change will allow the indirection through the GOT to
avoid the problem in those cases.

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

14 years ago8l: add PE dynexport
Wei Guangjing [Thu, 27 Jan 2011 13:26:31 +0000 (08:26 -0500)]
8l: add PE dynexport

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

14 years ago8l: fix ldpe sym name length == 8 strdup incorrect.
Wei Guangjing [Thu, 27 Jan 2011 13:26:28 +0000 (08:26 -0500)]
8l: fix ldpe sym name length == 8 strdup incorrect.

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

14 years agodoc/codelab/wiki: tests use available TCP port
Andrew Gerrand [Thu, 27 Jan 2011 13:19:37 +0000 (23:19 +1000)]
doc/codelab/wiki: tests use available TCP port

R=bradfitz, dsymonds, r2, dangabrad, rsc
CC=golang-dev
https://golang.org/cl/4043043

14 years agomisc/vim/syntax: set large value to 'syntax sync'.
Yasuhiro Matsumoto [Thu, 27 Jan 2011 13:03:52 +0000 (23:03 +1000)]
misc/vim/syntax: set large value to 'syntax sync'.

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

14 years agogo/scanner: fix build (adjust scanner EOF linecount)
Robert Griesemer [Thu, 27 Jan 2011 06:09:14 +0000 (22:09 -0800)]
go/scanner: fix build (adjust scanner EOF linecount)

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

14 years agogodoc: full text index for whitelisted non-Go files
Robert Griesemer [Thu, 27 Jan 2011 05:49:30 +0000 (21:49 -0800)]
godoc: full text index for whitelisted non-Go files

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

14 years agotoken/position: added SetLinesForContent
Robert Griesemer [Thu, 27 Jan 2011 05:49:10 +0000 (21:49 -0800)]
token/position: added SetLinesForContent

godoc uses this to provide full text index position information for
non-Go files.

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

14 years agogofmt -r: match(...) arguments may be nil; add missing guards
Robert Griesemer [Thu, 27 Jan 2011 03:17:53 +0000 (19:17 -0800)]
gofmt -r: match(...) arguments may be nil; add missing guards

Fixes #1446.

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

14 years agodoc/codelab/wiki: replace curl with a Go program
Andrew Gerrand [Thu, 27 Jan 2011 00:32:41 +0000 (10:32 +1000)]
doc/codelab/wiki: replace curl with a Go program

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

14 years agonetchan: Avoid race condition in test.
Ian Lance Taylor [Wed, 26 Jan 2011 23:51:04 +0000 (15:51 -0800)]
netchan: Avoid race condition in test.

Make sure we export the channels before we try to import
them.

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

14 years agonet: fix build on old Linux kernels
Russ Cox [Wed, 26 Jan 2011 20:46:15 +0000 (15:46 -0500)]
net: fix build on old Linux kernels
Thanks to Mike Beller for identifying the problem.

Fixes #1442.

R=bradfitz, bradfitzgo
CC=golang-dev
https://golang.org/cl/4102042

14 years agogo spec: clarify address operators.
Robert Griesemer [Wed, 26 Jan 2011 19:21:23 +0000 (11:21 -0800)]
go spec: clarify address operators.

Fixes #1445.

R=r, rsc, iant, ken2
CC=golang-dev
https://golang.org/cl/4109041

14 years agofmt/doc: define width and precision for strings.
Rob Pike [Wed, 26 Jan 2011 19:10:41 +0000 (11:10 -0800)]
fmt/doc: define width and precision for strings.

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

14 years agofaq: fix minor errors in programs reported by Wojciech Mikanik
Rob Pike [Wed, 26 Jan 2011 18:41:32 +0000 (10:41 -0800)]
faq: fix minor errors in programs reported by Wojciech Mikanik

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

14 years agocodelab/wiki: fix freebsd build
Russ Cox [Wed, 26 Jan 2011 18:02:09 +0000 (13:02 -0500)]
codelab/wiki: fix freebsd build

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

14 years agocodelab/wiki: fix build
Russ Cox [Wed, 26 Jan 2011 17:54:07 +0000 (12:54 -0500)]
codelab/wiki: fix build

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

14 years agonet: fix build
Russ Cox [Wed, 26 Jan 2011 17:38:06 +0000 (12:38 -0500)]
net: fix build

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

14 years agoencoding/line: make it an io.Reader too
Brad Fitzpatrick [Wed, 26 Jan 2011 14:59:53 +0000 (09:59 -0500)]
encoding/line: make it an io.Reader too

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

14 years agoruntime: remove tiny
Russ Cox [Wed, 26 Jan 2011 13:41:23 +0000 (08:41 -0500)]
runtime: remove tiny

It is unmaintained and untested, and I think it's broken too.
It was a toy to show that Go can run on real hardware,
and it served its purpose.

The source code will of course remain in the repository
history, so it could be brought back if needed later.

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

14 years agodoc/codelab/wiki: rename textarea name from Body to body
Andrew Gerrand [Wed, 26 Jan 2011 07:25:37 +0000 (17:25 +1000)]
doc/codelab/wiki: rename textarea name from Body to body

R=mattn
CC=golang-dev
https://golang.org/cl/4034046

14 years agodoc/codelab/wiki: update to work with template changes, add to run.bash
Andrew Gerrand [Wed, 26 Jan 2011 04:56:52 +0000 (14:56 +1000)]
doc/codelab/wiki: update to work with template changes, add to run.bash

Fixes #1444.

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

14 years agoruntime: fix windows build
Alex Brainman [Tue, 25 Jan 2011 22:50:15 +0000 (09:50 +1100)]
runtime: fix windows build

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

14 years agoruntime: prefer fixed stack allocator over general memory allocator
Russ Cox [Tue, 25 Jan 2011 21:35:36 +0000 (16:35 -0500)]
runtime: prefer fixed stack allocator over general memory allocator
  * move stack constants from proc.c to runtime.h
  * make memclr take uintptr length

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

14 years agoscanner: fix Position returned by Scan, Pos
Robert Griesemer [Tue, 25 Jan 2011 21:32:56 +0000 (13:32 -0800)]
scanner: fix Position returned by Scan, Pos

The implementation of the position computation
was surprisingly broken. Implemented fixes and
added extra test cases.

There is a slight interface change: Calling
Pos() returns the current position; but if
called before Scan() that position may not
be the position of the next token returned
by Scan() (depending on the scan settings
and the source text) - this in contrast to
the original comment.

However, after calling Scan(), the Scanner's
Position field reports the position of the
scanned token, as before.

Fixes #1327.

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

14 years agotime: allow cancelling of After events.
Roger Peppe [Tue, 25 Jan 2011 20:25:48 +0000 (12:25 -0800)]
time: allow cancelling of After events.
Also simplify sleeper algorithm and poll
occasionally so redundant sleeper goroutines
will quit sooner.

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

14 years agocc: fix -q and build break.
Luuk van Dijk [Tue, 25 Jan 2011 18:40:36 +0000 (19:40 +0100)]
cc: fix -q and build break.

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

14 years agocc: mode to generate go-code for types and variables.
Luuk van Dijk [Tue, 25 Jan 2011 18:00:14 +0000 (19:00 +0100)]
cc: mode to generate go-code for types and variables.

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

14 years agocrypto/dsa: add support for DSA
Adam Langley [Tue, 25 Jan 2011 17:25:53 +0000 (12:25 -0500)]
crypto/dsa: add support for DSA

R=bradfitzgo, r, bradfitzwork, nsz, rsc
CC=golang-dev
https://golang.org/cl/3990043

14 years agocrypto/rsa: correct docstring for SignPKCS1v15.
David Anderson [Tue, 25 Jan 2011 15:52:36 +0000 (10:52 -0500)]
crypto/rsa: correct docstring for SignPKCS1v15.

The docstring claims the function uses PSS message encoding,
when the function actually implements PKCS1-v1_5 encoding.

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

14 years agoCONTRIBUTORS: add David Anderson (Google CLA)
Russ Cox [Tue, 25 Jan 2011 15:48:44 +0000 (10:48 -0500)]
CONTRIBUTORS: add David Anderson (Google CLA)

R=agl1, danderson
CC=golang-dev
https://golang.org/cl/4029044

14 years agomake.bash: stricter selinux test
Russ Cox [Tue, 25 Jan 2011 15:19:39 +0000 (10:19 -0500)]
make.bash: stricter selinux test

SELinux can be installed but not turned on.
Don't complain unless it is actually turned on.

https://bugzilla.redhat.com/show_bug.cgi?id=652987#c20

R=agl
CC=golang-dev
https://golang.org/cl/3979044

14 years agoruntime: make Walk webbrowser example work
Hector Chu [Tue, 25 Jan 2011 06:56:33 +0000 (17:56 +1100)]
runtime: make Walk webbrowser example work

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

14 years agomisc: Import/Drop commands for Vim
Gustavo Niemeyer [Tue, 25 Jan 2011 01:36:13 +0000 (11:36 +1000)]
misc: Import/Drop commands for Vim

New ftplugin adds Import and Drop commands for Go buffers
in Vim.  These commands ensure that the provided package is
imported (or not imported) in the current Go buffer, using
proper style and ordering, without moving the cursor.

E.g.

    :Import strings
    :ImportAs . strings
    :Drop strings

Two mappings are also introduced to help with the fmt package:

    \f => :Import fmt
    \F => :Drop fmt

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

14 years agoscanner: error handler must be provided to Init
Robert Griesemer [Mon, 24 Jan 2011 22:12:20 +0000 (14:12 -0800)]
scanner: error handler must be provided to Init

Init may report an error on the first character and
thus one needs an ability to set the error handler
for Init. Was a design bug.

Added corresponding test cases and better documentation.
Also: Fixed a subtle infinite loop exposed by one of the
new test cases.

Fixes #1380.

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

14 years agosuffixarray: use binary search for both ends of Lookup
Eric Eisner [Mon, 24 Jan 2011 21:03:32 +0000 (13:03 -0800)]
suffixarray: use binary search for both ends of Lookup

This prevents many unnecessary comparisons when n is large.

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

14 years ago[68]l: more robust decoding of reflection type info in generating dwarf.
Luuk van Dijk [Mon, 24 Jan 2011 19:59:39 +0000 (20:59 +0100)]
[68]l: more robust decoding of reflection type info in generating dwarf.

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

14 years agocodereview: fix windows
Hector Chu [Mon, 24 Jan 2011 19:16:24 +0000 (14:16 -0500)]
codereview: fix windows

Uploading go files on Windows aborts with gofmt: exceptions.ValueError:
close_fds is not supported on Windows platforms if you redirect stdin/stdout/stderr

R=rsc, mattn, Joe Poirier
CC=golang-dev
https://golang.org/cl/4025046

14 years agocodereview: handle file patterns better
Russ Cox [Mon, 24 Jan 2011 19:14:26 +0000 (14:14 -0500)]
codereview: handle file patterns better

If a file pattern is given and matches files that look
like they need to be hg added or hg removed, offer to do so.

If a file pattern is given and matches files in another CL, warn.

If a file pattern doesn't match anything, point that out.

Vet first line of CL description.

Fixes #972.

R=adg, niemeyer
CC=bradfitzgo, golang-dev
https://golang.org/cl/4099042

14 years agotemplate: treat map keys as zero, not non-existent.
Roger Peppe [Mon, 24 Jan 2011 19:12:54 +0000 (14:12 -0500)]
template: treat map keys as zero, not non-existent.

R=adg, r, hoka, rsc
CC=golang-dev
https://golang.org/cl/4036045

14 years agonet: return cname in LookupHost
Russ Cox [Mon, 24 Jan 2011 19:12:43 +0000 (14:12 -0500)]
net: return cname in LookupHost

Fixes #1395.

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

14 years agoencoding/line: fix up a few typos and infelicities in the doc comments
Rob Pike [Mon, 24 Jan 2011 18:19:23 +0000 (10:19 -0800)]
encoding/line: fix up a few typos and infelicities in the doc comments

R=anschelsc, agl1
CC=golang-dev
https://golang.org/cl/3988045

14 years agojson: handle capital floating point exponent (1E100).
Pieter Droogendijk [Mon, 24 Jan 2011 08:10:50 +0000 (18:10 +1000)]
json: handle capital floating point exponent (1E100).

When parsing numbers with an exponent (like "12e-1"), the JSON scanner
would only allow a lowercase 'e', while the RFC also allows the
uppercase 'E'.

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

14 years agoA+C: Pieter Droogendijk
Andrew Gerrand [Mon, 24 Jan 2011 08:09:10 +0000 (18:09 +1000)]
A+C: Pieter Droogendijk

R=nigeltao, r2
CC=golang-dev
https://golang.org/cl/4061044

14 years agogob: report an error when encoding a non-empty struct with
Rob Pike [Sat, 22 Jan 2011 08:10:11 +0000 (00:10 -0800)]
gob: report an error when encoding a non-empty struct with
no public fields.
Fix a couple of tests caught out by this change.

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

14 years agoruntime: implementation of callback functions for windows
Alex Brainman [Sat, 22 Jan 2011 02:55:53 +0000 (13:55 +1100)]
runtime: implementation of callback functions for windows

R=rsc, lxn, alex.brainman, dho
CC=golang-dev
https://golang.org/cl/1696051

14 years agogob: fix the grammar comments to match the encoder
Rob Pike [Sat, 22 Jan 2011 00:10:39 +0000 (16:10 -0800)]
gob: fix the grammar comments to match the encoder
(or at least a correct encoder, still to come).
Change the debug structure slightly to better represent
the grammar.
Minor tweaks for consistency in type.go.

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

14 years agogc: clearer error for struct == struct
Russ Cox [Fri, 21 Jan 2011 23:15:59 +0000 (18:15 -0500)]
gc: clearer error for struct == struct

cmp6.go:48: invalid operation: t3 == t3 (operator == not defined on struct)

Fixes #1438.

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

14 years agonet: Fix race condition in test.
Ian Lance Taylor [Fri, 21 Jan 2011 21:57:52 +0000 (13:57 -0800)]
net: Fix race condition in test.

The test code used to do this:

for _, tc := range tests {
ch <- &tc
}

Note that &tc is always the same value here.  As the value is
received from the channel, the sender can loop around and
change the contents of tc.  This means that the receiver's
value is unstable and can change while it is in use.

R=adg, r2, rsc
CC=chris, golang-dev
https://golang.org/cl/3978043

14 years agospec, runtime, tests: send on closed channel panics
Russ Cox [Fri, 21 Jan 2011 20:07:13 +0000 (15:07 -0500)]
spec, runtime, tests: send on closed channel panics

Close of closed channel panics.
Receive from closed channel never panics,
even if done repeatedly.

Fixes #1349.
Fixes #1419.

R=gri, iant, ken2, r, gri1, r2, iant2, rog, albert.strasheim, niemeyer, ejsherry
CC=golang-dev
https://golang.org/cl/3989042