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

5366 Commits

Author SHA1 Message Date
Rob Pike
8a2d706487 regexp tests: make some benchmarks more meaningful
The first two "Literal" tests were silly.
Also fix a naming typo in a couple of tests.

R=rsc
CC=golang-dev
https://golang.org/cl/4127045
2011-02-01 17:48:42 -08:00
Robert Griesemer
3a54d43825 go/ast: add missing handling of SendStmt to ast.Walk
R=adg
CC=golang-dev
https://golang.org/cl/4044048
2011-02-01 16:57:45 -08:00
Russ Cox
1fa4173444 5l, 8l: pass stack frame size to morestack when needed
Shame on me: I fixed the same bug in 6l in 8691fcc6a66e
(https://golang.org/cl/2609041) and neglected
to look at 5l and 8l to see if they were affected.

On the positive side, the check I added in that CL is the
one that detected this bug.

Fixes #1457.

R=ken2
CC=golang-dev
https://golang.org/cl/3981052
2011-02-01 18:34:41 -05:00
Rob Pike
80f07cfbea arm: disable peep for release
R=ken2
CC=golang-dev
https://golang.org/cl/4001051
2011-02-01 15:02:07 -08:00
Robert Griesemer
288a39c86b go/ast: reflect communication operator changes accurately in ast
- go/ast: introduce SendStmt; adjust SelectStmt
- go/parser: accept new communication syntax, minor
  unrelated cleanups
- go/printer: adjustments for new ast, fewer binary
  expression precedences
- go/token: remove one binary precedence

Adjusted dependent code. gofmt -w src -misc. Ran all tests.

R=rsc, gri
CC=golang-dev
https://golang.org/cl/3989056
2011-02-01 13:47:51 -08:00
Ian Lance Taylor
9040da9e40 ld: Add -I option to set ELF interpreter.
R=rsc
CC=golang-dev
https://golang.org/cl/4080049
2011-02-01 12:49:56 -08:00
Rob Pike
eea18d959e log: rename Exit* to Fatal*
This aligns the naming scheme with the testing package and
also lets govet work on more logging calls.

R=rsc
CC=golang-dev
https://golang.org/cl/4001048
2011-02-01 12:47:35 -08:00
Rob Pike
6a13175f7d govet: add Panic to the list of functions
R=rsc
CC=golang-dev
https://golang.org/cl/4119049
2011-02-01 12:47:09 -08:00
Russ Cox
05b9050bda gc: handle invalid name in type switch
Fixes #1453.

R=ken2
CC=golang-dev
https://golang.org/cl/4125043
2011-02-01 14:00:36 -05:00
Jose Luis Vázquez González
865d576702 http: add host patterns
R=bradfitzgo, rsc
CC=golang-dev
https://golang.org/cl/4070043
2011-02-01 13:58:59 -05:00
Russ Cox
850ad9a402 strconv: add test that trips up other implementations
R=r, gri1
CC=golang-dev
https://golang.org/cl/4092045
2011-02-01 12:48:18 -05:00
Gustavo Niemeyer
59a47732dd 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
2011-02-01 12:12:51 -05:00
Eoghan Sherry
e6a934a1d9 6g: fix registerization of temporaries
Use correct range in allocated register test.

R=rsc, ken2
CC=golang-dev
https://golang.org/cl/4073049
2011-02-01 12:12:42 -05:00
Gustavo Niemeyer
e71d8a2fe4 6l: add comment to CMOV* relocation
R=rsc
CC=golang-dev
https://golang.org/cl/4042045
2011-02-01 11:49:33 -05:00
Hector Chu
62afa225af 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
2011-02-01 11:49:24 -05:00
Adam Langley
e308d55973 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
2011-02-01 11:02:48 -05:00
Mikio Hara
400ea843c6 syscall: add network interface constants for freebsd/386, freebsd/amd64
R=rsc
CC=golang-dev
https://golang.org/cl/4105046
2011-02-01 08:46:21 -05:00
Gustavo Niemeyer
4fd867b283 cgo: define CGO_CFLAGS and CGO_LDFLAGS in Go files
R=rsc, binet
CC=golang-dev
https://golang.org/cl/3921043
2011-02-01 08:44:18 -05:00
Russ Cox
0e47460915 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
2011-02-01 08:29:21 -05:00
Russ Cox
cb584707af gc: remove non-blocking send, receive syntax
R=ken2
CC=golang-dev
https://golang.org/cl/4126043
2011-01-31 18:52:16 -05:00
Russ Cox
f4e76d8309 replace non-blocking send, receive syntax with select
R=golang-dev, nigeltao, niemeyer, r
CC=golang-dev
https://golang.org/cl/4079053
2011-01-31 18:36:28 -05:00
Rob Pike
fc52d7029f unicode: update to unicode 6.0.0
R=rsc
CC=golang-dev
https://golang.org/cl/3981049
2011-01-31 15:20:44 -08:00
Russ Cox
614391860a ebnflint: exit with non-zero status on error
Tweak spec to avoid ebnflint complaints.

R=gri
CC=golang-dev
https://golang.org/cl/3973050
2011-01-31 17:42:10 -05:00
Eric Eisner
d93b2f384d 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
2011-01-31 13:13:02 -08:00
Albert Strasheim
161f109cad os: add ETIMEDOUT
R=rsc
CC=golang-dev
https://golang.org/cl/4017045
2011-01-31 14:54:58 -05:00
Roger Peppe
76130bdeea 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
2011-01-31 14:31:34 -05:00
Mikio Hara
5c0aab9cae syscall: add network interface constants for darwin/386, darwin/amd64
R=rsc
CC=golang-dev
https://golang.org/cl/4079049
2011-01-31 12:50:50 -05:00
Russ Cox
176d5769d9 lib9: update to Unicode 6.0.0
R=r
CC=golang-dev
https://golang.org/cl/4121042
2011-01-31 12:38:54 -05:00
Russ Cox
ad00644434 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
2011-01-31 11:50:04 -05:00
Luuk van Dijk
7400be87d8 runtime: generate Go defs for C types.
R=rsc, mattn
CC=golang-dev
https://golang.org/cl/4047047
2011-01-31 12:27:28 +01:00
Andrew Gerrand
9173a09530 bufio: make Flush a no-op when the buffer is empty
R=r
CC=golang-dev
https://golang.org/cl/4119048
2011-01-31 18:54:25 +11:00
Alex Brainman
3bfd35b72e run.bash: disable doc/codelab/wiki test on windows
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4119047
2011-01-31 15:58:44 +11:00
Ken Thompson
1f55105f66 enable arm peep.
one bug fixed,
probably more will be revealed

R=r
CC=golang-dev
https://golang.org/cl/4126044
2011-01-30 15:55:08 -08:00
Russ Cox
0f0f34ee05 unicode: add maketables to build, fix build
R=r
CC=golang-dev
https://golang.org/cl/4073046
2011-01-30 16:09:16 -05:00
Russ Cox
5038792837 gc: special case code for single-op blocking and non-blocking selects
R=ken2
CC=golang-dev
https://golang.org/cl/4004045
2011-01-30 16:07:57 -05:00
Rob Pike
08a206cc9e sync: a couple of documentation nits.
R=golang-dev, agl1
CC=golang-dev
https://golang.org/cl/4079051
2011-01-29 14:56:15 -08:00
Alex Brainman
d08df51366 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
2011-01-29 23:13:40 +11:00
Alex Brainman
89cc4d7814 runtime/cgo: fix cross-compiling windows packages
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4073043
2011-01-29 22:57:19 +11:00
Wei Guangjing
6606995c91 fix windows build
R=rsc
CC=golang-dev
https://golang.org/cl/4124041
2011-01-28 23:44:37 -05:00
Ian Lance Taylor
64c7f70c66 time: Support Solaris zoneinfo directory.
R=rsc
CC=golang-dev
https://golang.org/cl/4079047
2011-01-28 15:56:14 -08:00
Russ Cox
504da53c85 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
2011-01-28 17:17:38 -05:00
Russ Cox
4608feb18b 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
2011-01-28 15:03:26 -05:00
Rob Pike
50f574515c gob: fix build
delete reference to Debug function.

R=rsc
CC=golang-dev
https://golang.org/cl/4063048
2011-01-28 11:07:12 -08:00
Rob Pike
9b82481a96 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
2011-01-28 10:53:42 -08:00
Rob Pike
04a8905442 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
2011-01-28 10:53:06 -08:00
Robert Griesemer
9b07abab78 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
2011-01-27 14:11:58 -08:00
Evan Shaw
c9bf30cf19 bytes: Add Buffer.ReadBytes, Buffer.ReadString
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4000046
2011-01-27 14:00:31 -08:00
Gustavo Niemeyer
1a472026da 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
2011-01-27 14:09:03 -05:00
Wei Guangjing
a3120f67ca 8l: add PE dynexport
R=rsc, brainman, mattn
CC=golang-dev
https://golang.org/cl/4022043
2011-01-27 08:26:31 -05:00
Wei Guangjing
354219951e 8l: fix ldpe sym name length == 8 strdup incorrect.
R=rsc
CC=golang-dev
https://golang.org/cl/4102043
2011-01-27 08:26:28 -05:00
Robert Griesemer
1e17621cbe go/scanner: fix build (adjust scanner EOF linecount)
R=adg
CC=golang-dev
https://golang.org/cl/3990045
2011-01-26 22:09:14 -08:00
Robert Griesemer
4497960b2d godoc: full text index for whitelisted non-Go files
R=rsc
CC=golang-dev
https://golang.org/cl/4029046
2011-01-26 21:49:30 -08:00
Robert Griesemer
c2ea38ac7e 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
2011-01-26 21:49:10 -08:00
Robert Griesemer
32a7e46488 gofmt -r: match(...) arguments may be nil; add missing guards
Fixes #1446.

R=rsc
CC=golang-dev
https://golang.org/cl/3981043
2011-01-26 19:17:53 -08:00
Ian Lance Taylor
9a9c156a00 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
2011-01-26 15:51:04 -08:00
Russ Cox
f626696d21 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
2011-01-26 15:46:15 -05:00
Rob Pike
4e2218968c fmt/doc: define width and precision for strings.
R=rsc
CC=golang-dev
https://golang.org/cl/4061045
2011-01-26 11:10:41 -08:00
Russ Cox
e46e192857 net: fix build
R=adg
CC=golang-dev
https://golang.org/cl/3982051
2011-01-26 12:38:06 -05:00
Brad Fitzpatrick
3aee82b660 encoding/line: make it an io.Reader too
R=agl1, bradfitzwork, rsc
CC=golang-dev
https://golang.org/cl/4066043
2011-01-26 09:59:53 -05:00
Russ Cox
434f1e32a0 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
2011-01-26 08:41:23 -05:00
Andrew Gerrand
add4e167e3 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
2011-01-26 14:56:52 +10:00
Alex Brainman
b7949035d6 runtime: fix windows build
R=golang-dev
CC=golang-dev
https://golang.org/cl/4052046
2011-01-26 09:50:15 +11:00
Russ Cox
afc6928ad9 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
2011-01-25 16:35:36 -05:00
Robert Griesemer
eaae95fa3d 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
2011-01-25 13:32:56 -08:00
Roger Peppe
2ae953bfc3 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
2011-01-25 12:25:48 -08:00
Luuk van Dijk
66905bd9ac cc: fix -q and build break.
R=rsc
CC=golang-dev, golang-dev
https://golang.org/cl/3992047
2011-01-25 19:40:36 +01:00
Luuk van Dijk
efda876a94 cc: mode to generate go-code for types and variables.
R=rsc
CC=golang-dev
https://golang.org/cl/3987045
2011-01-25 19:00:14 +01:00
Adam Langley
166008b988 crypto/dsa: add support for DSA
R=bradfitzgo, r, bradfitzwork, nsz, rsc
CC=golang-dev
https://golang.org/cl/3990043
2011-01-25 12:25:53 -05:00
David Anderson
d0e6c7e134 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
2011-01-25 10:52:36 -05:00
Russ Cox
d9f1ddbee1 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
2011-01-25 10:19:39 -05:00
Hector Chu
90294a08c8 runtime: make Walk webbrowser example work
R=rsc, brainman, lxn
CC=golang-dev
https://golang.org/cl/4005045
2011-01-25 17:56:33 +11:00
Robert Griesemer
1161d19024 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
2011-01-24 14:12:20 -08:00
Eric Eisner
ab036abdf0 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
2011-01-24 13:03:32 -08:00
Luuk van Dijk
2aa6cf3e7e [68]l: more robust decoding of reflection type info in generating dwarf.
R=rsc
CC=golang-dev, golang-dev
https://golang.org/cl/4106041
2011-01-24 20:59:39 +01:00
Roger Peppe
72084068a4 template: treat map keys as zero, not non-existent.
R=adg, r, hoka, rsc
CC=golang-dev
https://golang.org/cl/4036045
2011-01-24 14:12:54 -05:00
Russ Cox
e7183e7518 net: return cname in LookupHost
Fixes #1395.

R=adg
CC=golang-dev
https://golang.org/cl/4036044
2011-01-24 14:12:43 -05:00
Rob Pike
4871d0d19a encoding/line: fix up a few typos and infelicities in the doc comments
R=anschelsc, agl1
CC=golang-dev
https://golang.org/cl/3988045
2011-01-24 10:19:23 -08:00
Pieter Droogendijk
c4513d3b6f 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
2011-01-24 18:10:50 +10:00
Rob Pike
a0a4e85ad6 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
2011-01-22 00:10:11 -08:00
Alex Brainman
f0b8f84d37 runtime: implementation of callback functions for windows
R=rsc, lxn, alex.brainman, dho
CC=golang-dev
https://golang.org/cl/1696051
2011-01-22 13:55:53 +11:00
Rob Pike
7f6ffade32 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
2011-01-21 16:10:39 -08:00
Russ Cox
7e84666df1 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
2011-01-21 18:15:59 -05:00
Ian Lance Taylor
9e441e5215 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
2011-01-21 13:57:52 -08:00
Russ Cox
27c74d3499 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
2011-01-21 15:07:13 -05:00
Rob Pike
5b5a674b46 gob: better debugging, commentary
Re-implement the debugging helper to be independent of the existing
implementation.  This is preparatory to a rewrite to clean up issue 1416.
Include a definition of the grammar of the data stream.

R=rsc
CC=golang-dev
https://golang.org/cl/3970045
2011-01-21 11:28:53 -08:00
Luuk van Dijk
5cf120827c cc: remove pickle generation code.
R=rsc
CC=golang-dev
https://golang.org/cl/4083043
2011-01-21 17:59:35 +01:00
Anschel Schaffer-Cohen
3921d26300 Use defer to unlock mutex in crypto/rand.
R=agl1
CC=golang-dev
https://golang.org/cl/3991045
2011-01-21 10:14:43 -05:00
Anschel Schaffer-Cohen
49e2888a96 Fixed documentation for netchan import()
This was broken after the last update (2011-01-20).
	However, I'm not sure if the changed example is a
	sensible use of import(), so I'd appreciate comments.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4067043
2011-01-20 19:58:08 -08:00
Robert Griesemer
955aa159ad godoc: show line numbers for non-go files (bug fix)
Also: Give line numbers a style and make them less intrusive.

R=rsc
CC=golang-dev
https://golang.org/cl/4060043
2011-01-20 10:43:55 -08:00
Russ Cox
3c7104479c runtime: drop CLONE_PARENT
The functionality we want (shared ppid) is implied
by CLONE_THREAD already, and CLONE_PARENT
causes problems if the Go program is pid 1 (init).

See issue 1406 for more details.

Fixes #1406.

R=adg, iant
CC=golang-dev
https://golang.org/cl/3971044
2011-01-20 13:36:00 -05:00
Russ Cox
32a8f5a874 gotest: new cgo does not require LD_LIBRARY_PATH
Fixes #1410.

R=r
CC=golang-dev
https://golang.org/cl/4072043
2011-01-20 13:11:06 -05:00
Miek Gieben
40c7449044 encoding/base32: new package
R=rsc
CC=Miek Gieben, golang-dev
https://golang.org/cl/3926041
2011-01-20 12:51:15 -05:00
Russ Cox
ecbcd816dc unsafe: add missing case to doc for Pointer
Fixes #1433.

R=r, gri
CC=golang-dev
https://golang.org/cl/3999047
2011-01-20 12:50:50 -05:00
Russ Cox
50fe459ce2 6g: fix uint64(uintptr(unsafe.Pointer(&x)))
Fixes #1417.

R=ken2
CC=golang-dev
https://golang.org/cl/4079042
2011-01-20 12:50:35 -05:00
Russ Cox
8b8cd0e4c4 http: follow relative redirect in Get
Fixes #1431.

R=bradfitz, dangabrad
CC=golang-dev
https://golang.org/cl/4077042
2011-01-20 12:50:27 -05:00
Russ Cox
e8f2692ca2 5l: document -F, force it on old ARMs
Fixes #1341.

R=ken2, r
CC=golang-dev
https://golang.org/cl/4006045
2011-01-20 12:50:10 -05:00
Wei Guangjing
f1751e7de5 8l: emit DWARF in Windows PE.
R=rsc, lvd, brainman, Joe Poirier
CC=golang-dev
https://golang.org/cl/2124041
2011-01-20 11:28:30 -05:00
Wei Guangjing
1aa2d88739 cgo: windows/386 port
R=rsc, peterGo, brainman
CC=golang-dev
https://golang.org/cl/3733046
2011-01-20 10:22:20 -05:00
Wei Guangjing
3aec5516ed 6l: windows/amd64 port
R=rsc
CC=golang-dev
https://golang.org/cl/3746044
2011-01-20 09:21:10 -05:00
Hector Chu
6c240d7671 runtime: fix tabs in windows/386/sys.s
R=rsc, brainman
CC=golang-dev
https://golang.org/cl/4030043
2011-01-20 09:21:04 -05:00
Russ Cox
4f269d3060 runtime: make select fairer
The o+i*p approach to visiting select cases in random
order stops being fair when there is some case that
is never ready.  If that happens, then the case that follows
it in the order gets more chances than the others.

In general the only way to ensure fairness is to make
all permutations equally likely.  I've done that by computing
one explicitly.

Makes the permutations correct for n >= 4 where
previously they were broken.  For n > 12, there's not
enough randomness to do a perfect job but this should
still be much better than before.

Fixes #1425.

R=r, ken2, ejsherry
CC=golang-dev
https://golang.org/cl/4037043
2011-01-20 09:20:47 -05:00
Adam Langley
0bec484e6f crypto/openpgp: add s2k
s2k implements the string-to-key functions for OpenPGP

R=rsc
CC=golang-dev
https://golang.org/cl/3937043
2011-01-20 07:38:34 -05:00
Alex Brainman
6d94b14e19 syscall: include all, even duplictate, invented error messages
Otherwise syscall.Errstr() returns "" for some (EWOULDBLOCK) errors.

R=rsc
CC=golang-dev
https://golang.org/cl/3941041
2011-01-20 21:24:15 +11:00
Alex Brainman
de2184f3a8 net: get tests working to fix windows build
R=golang-dev
CC=golang-dev
https://golang.org/cl/4089041
2011-01-20 19:18:04 +11:00
Russ Cox
b7bf2a3a0b net: fix windows build (?)
TBR=adg
CC=golang-dev
https://golang.org/cl/4083042
2011-01-20 00:16:16 -05:00
Russ Cox
f2b5a07453 delete float, complex - code changes
also:
	cmplx -> complex
	float64(1.0) -> 1.0
	float64(1) -> 1.0

R=gri, r, gri1, r2
CC=golang-dev
https://golang.org/cl/3991043
2011-01-19 23:09:00 -05:00
Russ Cox
0849944694 gc: delete float, complex
rename cmplx -> complex

R=ken2
CC=golang-dev
https://golang.org/cl/4071041
2011-01-19 23:08:11 -05:00
Andrew Gerrand
5eb8c9baa7 net: remove duplicate import of runtime
R=rsc
CC=golang-dev
https://golang.org/cl/3999046
2011-01-20 12:56:32 +11:00
Andrew Gerrand
0b08119adc syscall: attempt to fix windows build, supply missing constant
R=r, brainman, rsc1
CC=golang-dev
https://golang.org/cl/4023043
2011-01-20 12:41:59 +11:00
Adam Langley
4a7fed4d90 crypto/twofish: update with rsc's comments
TBR=rsc

R=rsc
CC=berengar.lehr, golang-dev
https://golang.org/cl/4050042
2011-01-19 19:41:27 -05:00
Ken Thompson
7963b04a18 arm bug with stack adjust
R=r
CC=golang-dev
https://golang.org/cl/3980043
2011-01-19 16:30:13 -08:00
Robert Griesemer
a441037f3f godoc: enable fulltext index by default
- added flag -maxresults (default: 10000) to limit the max.
  number of full text results shown
- removed flag -fulltext; use -maxresults=0 to disable fulltext
  index
- better indication on result page if not all results are shown
  (... after line list)

R=rsc, gri1
CC=golang-dev
https://golang.org/cl/4049042
2011-01-19 14:33:05 -08:00
Robert Griesemer
4e3f389476 godoc: enable qualified identifiers ("math.Sin") as query strings again
A query string of the form ident.ident will be used both as a qualified
identifier for identifier search and as a regular expression.
Qualified identifier lookup got broken accidentally when introducing
regexp full text search. Cleaned up surrounding logic a bit.

R=rsc
CC=golang-dev
https://golang.org/cl/3984042
2011-01-19 12:48:10 -08:00
Gustavo Niemeyer
c52ad23461 xml: handle tag paths through the same element
With the current implementation, xml unmarshalling
will silently fail to unmarshal any paths passing
through the same element, such as:

type T struct {
	A string "dummy>a"
	B string "dummy>b"
}

This change tweaks the algorithm so that this works
correctly.

Also, using paths that would cause the same element to
unmarshal twice will error out ahead of time explaining
the problem, rather than silently misbehaving.

R=rsc
CC=golang-dev
https://golang.org/cl/4082041
2011-01-19 15:43:58 -05:00
Rob Pike
b99a6d465a runtime/debug: fix build (missing Makefile)
Why does this happen so often?

R=rsc
CC=golang-dev
https://golang.org/cl/4067042
2011-01-19 12:36:52 -08:00
Jeff R. Allen
1558834248 5a, 5l, 6a, 6l, 8a, 8l: handle out of memory, large allocations
Fixes #392.

R=rsc, r2
CC=golang-dev
https://golang.org/cl/2732042
2011-01-19 15:30:26 -05:00
Roger Peppe
6fb1bf26ae netchan: do not block sends; implement flow control.
When data is received for a channel, but that channel
is not ready to receive it, the central run() loop
is currently blocked, but this can lead to deadlock
and interference between independent channels.
This CL adds an explicit buffer size to netchan
channels (an API change) - the sender will not
send values until the buffer is non empty.

The protocol changes to send ids rather than channel names
because acks can still be sent after a channel is hung up,
we we need an identifier that can be ignored.

R=r, rsc
CC=golang-dev
https://golang.org/cl/2447042
2011-01-19 12:28:49 -08:00
Rob Pike
89993544c2 runtime/debug: new package
Facilities for printing stack traces from within a running goroutine.

R=rsc
CC=golang-dev
https://golang.org/cl/4031041
2011-01-19 12:28:38 -08:00
Russ Cox
035fcb0da2 net: fix build on freebsd
TBR=adg
CC=golang-dev
https://golang.org/cl/3992044
2011-01-19 15:24:25 -05:00
Brad Fitzpatrick
f96c1d076a http: support for relative URLs
R=rsc, adg
CC=golang-dev
https://golang.org/cl/4002041
2011-01-19 15:13:42 -05:00
Kyle Lemons
a4f6ed3574 net: add LookupAddr
R=adg, rsc
CC=golang-dev
https://golang.org/cl/3851041
2011-01-19 15:11:03 -05:00
Hector Chu
aae5f91213 windows: implement exception handling
R=rsc, brainman
CC=golang-dev
https://golang.org/cl/4079041
2011-01-19 15:10:15 -05:00
Alex Brainman
48d2de7eb9 8l: pe changes
Dll names and function names padded to even size.
Refactoring of imports writing code.

R=rsc
CC=golang-dev
https://golang.org/cl/3804042
2011-01-19 15:10:01 -05:00
Wei Guangjing
ff25900bb6 net: implement windows timeout
R=brainman, rsc
CC=golang-dev
https://golang.org/cl/1731047
2011-01-19 14:49:25 -05:00
Albert Strasheim
3a97119517 net, syscall: return source address in Recvmsg
R=rsc
CC=golang-dev
https://golang.org/cl/3766042
2011-01-19 14:34:53 -05:00
Sebastien Binet
655da99627 cgo: add complex float, complex double
R=rsc
CC=binet, golang-dev
https://golang.org/cl/3906041
2011-01-19 14:30:57 -05:00
Eoghan Sherry
13c2e62966 math: handle denormals in Frexp, Ilogb, Ldexp, and Logb
Also:
* document special cases for Frexp and Ldexp
* handle ±Inf in Ldexp
* correctly return -0 on underflow in Ldexp
* test special cases for Ldexp
* test boundary cases for Frexp, Ilogb, Ldexp, and Logb

R=rsc
CC=golang-dev
https://golang.org/cl/3676041
2011-01-19 14:23:59 -05:00
Albert Strasheim
01fad6a6b0 net: add unixpacket
R=golang-dev, rsc, rsc1
CC=golang-dev
https://golang.org/cl/2309043
2011-01-19 14:21:58 -05:00
Ben Lynn
eb56a79e99 regexp: reject bare ?
Minor cleanup:
  - removed a duplicate test case
  - added a function to remove repeated code
  - for consistency, replaced "return nil" with a panic at an
    unreachable point

Fixes #1428.

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/4057042
2011-01-19 13:47:04 -05:00
Russ Cox
bcd910cfe2 runtime: add per-pause gc stats
R=r, r2
CC=golang-dev
https://golang.org/cl/3980042
2011-01-19 13:41:42 -05:00
Russ Cox
61a4e9812e fmt: document %X of string, []byte
suggested by Mark Summerfield

R=r
CC=golang-dev
https://golang.org/cl/4018042
2011-01-19 13:35:45 -05:00
Clement Skau
49741f23d5 http: fix Content-Range and Content-Length in response
RFC2616 sections 4.4 and 14.16:
  * Cannot use Content-Length with non-identity Transfer-Encoding
  * Content-Range response is "bytes x-y/z" not "x-y/z"

R=rsc
CC=golang-dev
https://golang.org/cl/4018041
2011-01-19 10:05:48 -05:00
Corey Thomasson
43582bad33 net: avoid nil dereference if /etc/services can't be opened
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4081041
2011-01-19 09:55:46 -05:00
Yasuhiro Matsumoto
4a7cdc7944 syscall: fix build. WUNTRACED isn't defined for win32.
For Windows, the options for syscall.Wait4() aren't used.
Then this will be dummy value like WNOHANG, WSTOPPED.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4075041
2011-01-18 23:00:19 -08:00
Rob Pike
052ff45690 crypto/cipher: fix build (missing file in Makefile)
R=agl, adg
CC=golang-dev
https://golang.org/cl/4073041
2011-01-18 20:56:55 -08:00
Ken Thompson
eead5e8879 arm register allocation/tempname allocation bug
R=r
CC=golang-dev
https://golang.org/cl/4008044
2011-01-18 20:45:17 -08:00
Adam Langley
9b6d8b3c4f crypto/cipher: add OFB mode
R=rsc, r
CC=golang-dev
https://golang.org/cl/3994042
2011-01-18 18:16:06 -05:00
Russ Cox
3e0adc9ffb cc: fix vlong condition
Fixes #1032.

R=ken2
CC=golang-dev
https://golang.org/cl/4025043
2011-01-18 16:28:21 -05:00
Russ Cox
b0543ddd8a gc, runtime: make range on channel safe for multiple goroutines
Fixes #397.

R=ken2
CC=golang-dev
https://golang.org/cl/3994043
2011-01-18 15:59:19 -05:00
Gustavo Niemeyer
3426b80dd9 xml: support for > in tags
This introduces support for selecting which subelement
to unmarshal into a given struct field by providing a
nesting path separated by the > character.

R=rsc
CC=golang-dev
https://golang.org/cl/4066041
2011-01-18 15:39:38 -05:00
Russ Cox
12307008e9 runtime: print signal information during panic
$ 6.out
panic: runtime error: invalid memory address or nil pointer dereference

[signal 11 code=0x1 addr=0x0 pc=0x1c16]

runtime.panic+0xa7 /Users/rsc/g/go/src/pkg/runtime/proc.c:1089
	runtime.panic(0xf6c8, 0x25c010)
runtime.panicstring+0x69 /Users/rsc/g/go/src/pkg/runtime/runtime.c:88
	runtime.panicstring(0x24814, 0x0)
runtime.sigpanic+0x144 /Users/rsc/g/go/src/pkg/runtime/darwin/thread.c:465
	runtime.sigpanic()
main.f+0x16 /Users/rsc/x.go:5
	main.f()
main.main+0x1c /Users/rsc/x.go:9
	main.main()
runtime.mainstart+0xf /Users/rsc/g/go/src/pkg/runtime/amd64/asm.s:77
	runtime.mainstart()
runtime.goexit /Users/rsc/g/go/src/pkg/runtime/proc.c:149
	runtime.goexit()

R=r
CC=golang-dev
https://golang.org/cl/4036042
2011-01-18 14:15:11 -05:00
Russ Cox
acd858eee0 syscall: correct WSTOPPED on OS X
Have to set #defines correctly to get correct value.
Otherwise get a mask for use in implementing WIFSTOPPED(status).

Changed WSTOPPED definition in os because on
OS X WSTOPPED and WUNTRACED have different values
even though they seem to mean the same thing.

Fixes #1374.

R=r, r2
CC=golang-dev
https://golang.org/cl/4063042
2011-01-18 14:02:41 -05:00
Robert Griesemer
1b112c2297 godoc: bring back "indexing in progress" message
A wrongly nested if prevented the message from appearing.

Fixes #1420.

R=r, r2
CC=golang-dev
https://golang.org/cl/3987043
2011-01-18 10:59:54 -08:00
Anthony Martin
661bcb773b gc: fix typed constant declarations
Fixes #1411.

R=rsc, gri, ejsherry
CC=golang-dev
https://golang.org/cl/4035042
2011-01-18 11:24:49 -05:00
Jos Visser
25f762c75b expvar: add Float
R=r, rsc, dsymonds
CC=golang-dev
https://golang.org/cl/4044041
2011-01-18 11:24:43 -05:00
Ian Lance Taylor
2862d003cb syscall: Correct length of GNU/Linux abstract Unix domain sockaddr.
R=rsc, iant2
CC=golang-dev
https://golang.org/cl/3974044
2011-01-18 08:10:22 -08:00
Ken Thompson
fa9befd777 arm reg bug with SP adjust
after call to deferproc

R=r
CC=golang-dev
https://golang.org/cl/4059041
2011-01-17 20:39:26 -08:00
Ken Thompson
3537b79329 arm bug address of a string
R=r
CC=golang-dev
https://golang.org/cl/4004042
2011-01-17 13:27:05 -08:00
Ken Thompson
3965519ae5 arm reg bug with address(variable)
R=r
CC=golang-dev
https://golang.org/cl/4047041
2011-01-16 15:25:13 -08:00
Ken Thompson
6432471497 disable reg - tar test failed
R=r
CC=golang-dev
https://golang.org/cl/3969042
2011-01-15 17:11:24 -08:00
Ken Thompson
2c35e548bb arm reg bug MOVW into bool variable
R=r
CC=golang-dev
https://golang.org/cl/4034042
2011-01-15 16:55:47 -08:00
Rob Pike
7b4495c041 bytes.Buffer: fix typo in comment (doubled 'to')
R=ken2
CC=golang-dev
https://golang.org/cl/4035041
2011-01-14 23:00:02 -08:00
Russ Cox
141a4a1759 runtime: fix arm reflect.call boundary case
The fault was lucky: when it wasn't faulting it was silently
copying a word from some other block and later putting
that same word back.  If some other goroutine had changed
that word of memory in the interim, too bad.

The ARM code was inconsistent about whether the
"argument frame" included the saved LR.  Including it made
some things more regular but mostly just caused confusion
in the places where the regularity broke.  Now the rule
reflects reality: argp is always a pointer to arguments,
never a saved link register.

Renamed struct fields to make meaning clearer.

Running ARM in QEMU, package time's gotest:
  * before: 27/58 failed
  * after: 0/50

R=r, r2
CC=golang-dev
https://golang.org/cl/3993041
2011-01-14 14:05:20 -05:00
Ian Lance Taylor
5adfe93752 cgo: In _cgo_main.c define all provided symbols as functions.
This defines crosscall2 in a way that matches that real
definition, and also defines _cgo_allocate and _cgo_panic to
indicate that they are available to be called by code compiled
with gcc.

R=rsc
CC=golang-dev
https://golang.org/cl/4026041
2011-01-14 10:52:08 -08:00
Ian Lance Taylor
b97005c1d3 runtime/cgo: Don't define crosscall2 in dummy _cgo_main.c.
In this specific package crosscall2 is already defined in a .S
file anyhow.  This avoids a warning about mismatched
alignment.

R=rsc
CC=golang-dev
https://golang.org/cl/4000043
2011-01-14 10:51:47 -08:00
Ian Lance Taylor
18941a75b7 syscall: Correct length of SockaddrUnix.
R=rsc
CC=golang-dev
https://golang.org/cl/4025041
2011-01-14 10:50:51 -08:00
Robert Griesemer
157cd6ef3a gofmt, go/printer: do not insert extra linebreaks where they may break the code
Introduced a printer mode (pmode) type and corresponding
pmode values which permit easy toggling of the current
printer mode for fine-tuning of layout.

Use the printer mode to disable potential introduction of
line breaks before a closing '}' in composite literals.

Added extra test case. Applied gofmt to src and misc.

Fixes #1365.

R=r2
CC=golang-dev
https://golang.org/cl/4008041
2011-01-14 09:42:37 -08:00
Ken Thompson
a093f3d5a0 fix tst instruction on arm to set overflow bit
R=r
CC=golang-dev
https://golang.org/cl/4009041
2011-01-13 20:05:08 -08:00
Robert Griesemer
4ed7c59a50 fix build (this time for real): adjust typechecker test, ogle
R=r, r2
CC=golang-dev
https://golang.org/cl/4006041
2011-01-13 17:41:45 -08:00
Robert Griesemer
8b41055656 fix build (submitted a modified parser.go file by mistake)
R=r
CC=golang-dev
https://golang.org/cl/4005041
2011-01-13 17:26:38 -08:00
Robert Griesemer
bff2c207e4 go/scanner: Make Init take a *token.File instead of a *token.FileSet.
Until now, each scan of a file added a new file to the file set.
With this change, a file can be re-scanned using the same *token.File
w/o changing the file set. Eventually this will enable the re-use of
cached source code in godoc (for the fulltext index). At the moment,
source files are read over and over again from disk.

This is the first step in that direction.

R=r, rsc, r2
CC=golang-dev
https://golang.org/cl/4001041
2011-01-13 17:20:26 -08:00
Rob Pike
b814cca3c3 cmath test: fix format (%g does not print booleans)
R=ken
CC=golang-dev
https://golang.org/cl/4003041
2011-01-13 16:30:56 -08:00
Ken Thompson
2a74009675 add TST op code
R=r
CC=golang-dev
https://golang.org/cl/4000041
2011-01-13 15:34:52 -08:00
Brad Fitzpatrick
b448263f79 http: fix scheme-relative URL parsing; add ParseRequestURL
Also adds some tests for Issue 900 which was the reason
the current URL parsing is broken.  (the previous fix
was wrong)

R=rsc, adg, dangabrad, bradfitzwork
CC=golang-dev
https://golang.org/cl/3910042
2011-01-14 09:10:02 +11:00
Robert Griesemer
f6f1401286 godoc: don't double HTML-escape search result snippets
Fixes #1412.

R=rsc, r
CC=golang-dev
https://golang.org/cl/3994041
2011-01-13 12:44:04 -08:00
Russ Cox
cdb0bbf4d5 http: handle HEAD requests correctly
R=r, r2
CC=golang-dev
https://golang.org/cl/3939042
2011-01-13 14:34:31 -05:00
Robert Griesemer
d4bdaf11d9 godoc: peephole optimization for generated HTML
When searching for regular expressions such as
".", there are many consecutive matches.
In the generated HTML, combine them instead of
generating a new <span> for each adjacent text
segment highlighting a match.

Massively reduces the size of the generated
HTML in those cases.

R=r, rsc
CC=golang-dev
https://golang.org/cl/3971041
2011-01-13 10:23:42 -08:00
Rob Pike
d88f717da6 disable arm registifier for the moment
R=ken2, ken3
CC=golang-dev
https://golang.org/cl/3970041
2011-01-12 16:17:14 -08:00
Rob Pike
51b8d23e3b rpc: export names in debug service so it works with template changes
R=dsymonds
CC=golang-dev
https://golang.org/cl/3760049
2011-01-12 15:23:21 -08:00
Gustavo Niemeyer
6f6b7e3a33 goinstall: Fix template to use exported fields
It's currently broken due to f6d5bac536c5.

R=r, r2
CC=golang-dev
https://golang.org/cl/3967041
2011-01-12 10:45:24 -08:00
Rob Pike
699864b696 encoding/line: fix error call (missing argument)
R=agl1, rsc
CC=golang-dev
https://golang.org/cl/3861044
2011-01-12 00:25:29 -08:00
Rob Pike
29cbad6c72 template: give "unexported" error when accessing an unexported field.
R=adg, rsc
CC=golang-dev
https://golang.org/cl/3903043
2011-01-12 00:25:17 -08:00
Eric Eisner
e3c9565b43 suffixarray: faster creation algorithm
This implements the algorithm qsufsort using the sort package
as a sorting primitive. Its worst-case performance is O(N*log(N)), and it
uses only an additional slice of N ints of memory during creation.

Benchmarks (seconds):
           old    new
10k nulls          149    0.044
1M English corpus  32.0   3.6

R=gri, gri1
CC=golang-dev
https://golang.org/cl/3752044
2011-01-11 21:46:50 -08:00
Robert Griesemer
7b4a4d3788 godoc: remove TODO (bug257.go can now be indexed)
Pending CL 3752044.

R=r, r2
CC=golang-dev
https://golang.org/cl/3949042
2011-01-11 21:24:44 -08:00
Alex Brainman
3a052b5f54 net: use closesocket api instead of CloseHandle on Windows
thanks to piotrnar for the original CL.
Fixes #1371.

R=rsc
CC=golang-dev
https://golang.org/cl/3834042
2011-01-12 15:55:17 +11:00
Rob Pike
a80cdcbe0a gob: make (en|dec)code(Ui|I)nt methods rather than functions.
No functional (ha!) change.

R=rsc
CC=golang-dev
https://golang.org/cl/3959041
2011-01-11 17:56:45 -08:00
Adam Langley
5aeacadc5a crypto/openpgp: add error and armor
error is needed by all the OpenPGP packages as they return a shared
family of error types.

armor implements OpenPGP armoring. It's very like PEM except:
  a) it includes a CRC24 checksum
  b) PEM values are small (a few KB) and so encoding/pem assumes that
     they fit in memory. Armored data can be very large and so this
     package presents a streaming interface.

R=r, nsz, rsc
CC=golang-dev
https://golang.org/cl/3786043
2011-01-11 20:54:30 -05:00
Berengar Lehr
1aec7c7f34 crypto: add twofish package
The code was (as annotated in the source code) adopted from Tom's
LibCrypt (public domain code, [1]). It was neither optimised for speed
nor were any security features added.

[1] http://libtom.org/?page=features&newsitems=5&whatfile=crypt

R=rsc, berengarlehr, albert.strasheim, agl1
CC=golang-dev, schulze
https://golang.org/cl/2687042
2011-01-11 20:51:35 -05:00
Ken Thompson
1c99bdc8e5 turn off peep half of optimizer for release
R=r
CC=golang-dev
https://golang.org/cl/3919043
2011-01-11 17:30:25 -08:00
Andrew Gerrand
09d4bcf0f7 json: do not Marshal unexported struct fields
R=r, cw, niemeyer, rsc
CC=golang-dev
https://golang.org/cl/3952041
2011-01-12 11:59:33 +11:00
Alex Brainman
a41d85498e runtime: revert 6974:1f3c3696babb
I missed that environment is used during runtime setup,
well before go init() functions run. Implemented os-dependent
runtime.goenvs functions to allow for different unix, plan9 and
windows versions of environment discovery.

R=rsc, paulzhol
CC=golang-dev
https://golang.org/cl/3787046
2011-01-12 11:48:15 +11:00
Andrew Gerrand
217693e93c os: add Sync to *File, wraps syscall.Fsync
R=rsc, brainman, r, r2
CC=golang-dev
https://golang.org/cl/3887042
2011-01-12 11:08:39 +11:00
Rob Pike
02e88019f2 template: allow accesses only to exported fields and methods
R=rsc, gri
CC=golang-dev
https://golang.org/cl/3890042
2011-01-11 15:47:45 -08:00
Ian Lance Taylor
ac1c09458c ld: Fix exported dynamic symbols on 386 Mach-O.
R=rsc
CC=golang-dev
https://golang.org/cl/3948043
2011-01-11 14:43:28 -08:00
Russ Cox
cc928b7b6e http: fix text displayed in Redirect
In the case where r.Method == "POST", was
calling Printf with an argument but "" format string,
causing a spurious %!EXTRA(...) message.

Also escape string properly in HTML generation.

R=r
CC=golang-dev
https://golang.org/cl/3923043
2011-01-11 17:15:28 -05:00
Ian Lance Taylor
3a43ff1a77 ld: Fix exported dynamic symbols on Mach-O.
* Avoid confusion between imported and exported symbols.
* Record number of imported and exported symbols correctly.
* Explictly relocate SMACHOSYM section, since it is not in datap.

R=rsc
CC=golang-dev
https://golang.org/cl/3920042
2011-01-11 13:56:47 -08:00
Rob Pike
3036604b4c gob: do not encode or decode unexported fields
Such fields are simply ignored.

R=rsc, r2
CC=golang-dev
https://golang.org/cl/3889043
2011-01-11 13:44:00 -08:00
Rob Pike
feb8d0b2ba netchan: make fields public for pending gob change
R=rsc
CC=golang-dev
https://golang.org/cl/3882042
2011-01-11 13:43:43 -08:00
Anthony Martin
fee3aca2e0 syscall: fix mksysnum_linux.sh
A few system call numbers on x86 Linux are
defined in terms of a previous definition,

e.g.,
	#define __NR_timer_create	259
	#define __NR_timer_settime	(__NR_timer_create+1)
	...
	#define __NR_mq_open		277
	#define __NR_mq_unlink		(__NR_mq_open+1)

This change assumes the numbers are sorted
sequentially in the input file.

R=rsc, bradfitzwork
CC=golang-dev
https://golang.org/cl/3946041
2011-01-11 14:38:14 -05:00
Ian Lance Taylor
882f9d6d7a ld: Permit an Mach-O symbol to be exported in the dynamic symbol table.
Submitting TBR to fix Darwin build.

R=rsc
TBR=rsc
CC=golang-dev
https://golang.org/cl/3912043
2011-01-11 11:22:47 -08:00
Gustavo Niemeyer
03b46849f2 goinstall: preliminary support for cgo packages
Can handle cgo packages now but only if they
do not need to set CGO_LDFLAGS and CGO_CFLAGS.

R=adg, rsc
CC=golang-dev
https://golang.org/cl/3891042
2011-01-11 13:14:48 -05:00
Rob Pike
f9f196c2a0 log: add methods for exit and panic
There were already functions for the standard logger;
this just completes the set.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/3901043
2011-01-11 09:57:47 -08:00
Ian Lance Taylor
17d50d8664 runtime/cgo: Add callbacks to support SWIG.
R=rsc, iant2, r
CC=golang-dev
https://golang.org/cl/3886041
2011-01-11 09:36:44 -08:00
Russ Cox
5b8bcf2324 godefs: better handling of enums
Fixes #432.

R=r, r2
CC=golang-dev
https://golang.org/cl/3869043
2011-01-11 11:12:15 -05:00
Gustavo Niemeyer
9f178edf51 cgo: export unsafe.Pointer as void*
This will enable functions which use unsafe.Pointer as an argument
to be correctly exported by cgo.

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

Fixes #1400.

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

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

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

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

- various typo fixes and minor cleanups throughout

Missing:
- indexing of non-.go files

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

R=rsc, r
CC=golang-dev
https://golang.org/cl/3905041
2011-01-10 11:51:38 -08:00