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

5893 Commits

Author SHA1 Message Date
Rob Pike
2fca1a4049 lib9/create.c: delete unused variable
fixes build with GCC4.6

R=adg
CC=golang-dev
https://golang.org/cl/4396048
2011-04-13 23:12:48 -07:00
Russ Cox
507df959e4 runtime: drop chan circular linked list in favor of circular buffer
The list elements are already being allocated out of a
single memory buffer.  We can drop the Link* pointer
following and the memory it requires, replacing it with
index operations.

The change also keeps a channel from containing a pointer
back into its own allocation block, which would create a
cycle.  Blocks involved in cycles are not guaranteed to be
finalized properly, and channels depend on finalizers to
free OS-level locks on some systems.  The self-reference
was keeping channels from being garbage collected.

runtime-gdb.py will need to be updated in order to dump
the content of buffered channels with the new data structure.

Fixes #1676.

R=ken2, r
CC=golang-dev
https://golang.org/cl/4411045
2011-04-13 23:42:06 -04:00
Russ Cox
4c006182dc pkg: manual cleanup of some gofixed code
R=golang-dev, niemeyer, r
CC=golang-dev
https://golang.org/cl/4372052
2011-04-13 23:36:00 -04:00
Russ Cox
017e73c1b2 gc: fix func syntax error
Fixes #1685.

R=ken2
CC=golang-dev
https://golang.org/cl/4414042
2011-04-13 22:48:21 -04:00
Corey Thomasson
785fbd94fd net: sort records returned by LookupMX
R=rog, adg, rsc
CC=golang-dev
https://golang.org/cl/4388048
2011-04-14 10:30:56 +10:00
Rob Pike
bb855f985a govet: make name-matching for printf etc. case-insensitive.
Update goyacc, cgo to be more canonical in their naming and silence the new warnings.

R=rsc, gri
CC=golang-dev
https://golang.org/cl/4417042
2011-04-13 16:57:44 -07:00
Nigel Tao
4c60569e7c image: allow "?" wildcards when registering image formats.
R=r, nigeltao_gnome
CC=golang-dev
https://golang.org/cl/4404041
2011-04-14 09:56:42 +10:00
Robert Griesemer
a2e286828b gofmt: gofmt -s -w src misc
R=r, bradfitzwork
CC=golang-dev
https://golang.org/cl/4406044
2011-04-13 15:13:59 -07:00
Rob Pike
179f0b8a07 libmach: fix the windows build.
Newly enabled compiler errors need workaround.

R=rsc
CC=golang-dev
https://golang.org/cl/4397047
2011-04-13 14:57:47 -07:00
Robert Griesemer
5666ec8735 fix build: disable gofmt test script, enable gotest testing instead
R=rsc
CC=golang-dev
https://golang.org/cl/4403045
2011-04-13 14:24:38 -07:00
Brad Fitzpatrick
c7d16cc411 http: flesh out server Expect handling + tests
This mostly adds Expect 100-continue tests (from
the perspective of server correctness) that were
missing before.

It also fixes a few missing cases that will
probably never come up in practice, but it's nice
to have handled correctly.

Proper 100-continue client support remains a TODO.

R=rsc, bradfitzwork
CC=golang-dev
https://golang.org/cl/4399044
2011-04-13 14:09:04 -07:00
Robert Griesemer
99f069a97f gofmt: add test framework in Go
- replaced existing testdata/test.sh with new gofmt_test
- added initial test case for rewrite tests

TODO: Need to add more tests.

R=rsc
CC=golang-dev
https://golang.org/cl/4368063
2011-04-13 13:59:59 -07:00
Robert Griesemer
3d4b55ad5b gofmt: minor refactor to permit easy testing
R=rsc
CC=golang-dev
https://golang.org/cl/4397046
2011-04-13 13:57:53 -07:00
Russ Cox
7b6ee1a5d4 reflect: inline method implementations
This CL is only cut-and-paste, moving code around.
Moving it in a separate CL should simplify the diffs in later CLs.

There are three patterns here.

1. A function like
        func (v Value) M() (...) {
                return v.panicIfNot(K).(*kValue).M()
        }
becomes
        func (v Value) M() (...) {
                vv := v.panicIfNot(K).(*kValue)

                // body of (*kValue).M, s/v./vv./g
        }

2. A function like
        func (v Value) M() (...) {
                return v.panicIfNots(kList).(mer).M()
        }
becomes
        func (v Value) M() (...) {
                switch vv := v.panicIfNots(kList).(type) {
                case *k1Value:
                        // body of (*k1Value).M, s/v./vv./g
                case *k2Value:
                        // body of (*k2Value).M, s/v./vv./g
                ...
                }
                panic("not reached")
        }

3. The rewrite of Value.Set follows 2, but each case
is built from the bodies of (*kValue).SetValue and (*kValue).Set.
        func (v *kValue) SetValue(x Value) {
                v.Set(x.panicIfNot(K).(*kValue)
        }
        func (v *kValue) Set(x *kValue) {
                ... body
        }
becomes, in the switch from 2,
                case *kValue:
                        xx := x.panicIfNot(K).(*kValue)
                        ... body, s/v./vv./g; s/x./xx./g

R=r
CC=golang-dev
https://golang.org/cl/4398044
2011-04-13 16:55:20 -04:00
Rob Pike
e6cf42c39a gofix: fix embarrassing typo in osopen.go
R=rsc, gri
CC=golang-dev
https://golang.org/cl/4411044
2011-04-13 13:49:24 -07:00
Russ Cox
4c5dd0e1ee libmach: fix freebsd compiler errors
TBR=r
CC=golang-dev
https://golang.org/cl/4396045
2011-04-13 16:26:25 -04:00
Russ Cox
1499c78281 build: tidy intermediate files during build
This CL changes the behavior of 'make install' and 'make test'
in the src/cmd directory and the src/pkg directory to have
each recursive make clean up after itself immediately.

It does the same in test/run, removing $F.$A and $A.out
(the common byproducts) between runs.

On machines with slow disks and aggressive kernel caching,
cleaning up immediately can mean that the intermediate
objects never get written to disk.

This change eliminates almost all the disk waiting during
all.bash on my laptop (a Thinkpad X201s with an SSD running Linux).

147.50u 19.95s 277.34r	before
148.53u 21.64s 179.59r	after

R=golang-dev, r, iant2
CC=golang-dev
https://golang.org/cl/4413042
2011-04-13 16:24:57 -04:00
Russ Cox
1d26908d3f build: use gcc -Werror
Better to fix the warnings that we find.

R=iant
CC=golang-dev
https://golang.org/cl/4406042
2011-04-13 16:18:09 -04:00
Russ Cox
da8c5e7239 os/inotify: use _test for test files, not _obj
R=golang-dev, r, iant2
CC=golang-dev
https://golang.org/cl/4408043
2011-04-13 16:17:49 -04:00
Adam Langley
6392fc75cf bufio: add ReadLine
It matches encoding/line exactly and the tests are copied from there.
If we land this, then encoding/line will get marked as deprecated then
deleted in time.

R=rsc, rog, peterGo
CC=golang-dev
https://golang.org/cl/4389046
2011-04-13 15:12:28 -04:00
Brad Fitzpatrick
0be2ef3fc4 io: clarify that ReadAt shouldn't move the seek offset
R=r, mkrautz, r2, rsc
CC=golang-dev
https://golang.org/cl/4415041
2011-04-13 11:18:38 -07:00
Robert Griesemer
a5ca635287 gofmt: avoid endless loops
With the (partial) resolution of identifiers done
by the go/parser, ast.Objects point may introduce
cycles in the AST. Don't follow *ast.Objects, and
replace them with nil instead (they are likely
incorrect after a rewrite anyway).

- minor manual cleanups after reflect change automatic rewrite
- includes fix by rsc related to reflect change

Fixes #1667.

R=rsc
CC=golang-dev
https://golang.org/cl/4387044
2011-04-13 09:38:13 -07:00
Robert Griesemer
7c270aef08 go/ast: fixed bug in NotNilFilter, added test
- fixed a couple of comments
- cleanups after reflect change

R=rsc
CC=golang-dev
https://golang.org/cl/4389041
2011-04-13 09:37:13 -07:00
David Symonds
1de71a07e0 archive/tar: fix example's handling of os.EOF.
Fixes #1677.

R=r
CC=golang-dev
https://golang.org/cl/4402042
2011-04-13 10:56:33 +10:00
Fazlul Shahriar
08b0927771 os: fix Readdir in Plan 9
'TestReaddir.*' tests now passes.

R=golang-dev, lucio, r
CC=golang-dev
https://golang.org/cl/4381048
2011-04-12 16:58:56 -07:00
Lucio De Re
36b6d1aaf2 8l: correct Plan 9 compiler warnings
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4390047
2011-04-12 16:21:01 -04:00
Rob Pike
4fe9f57413 fmt: allow %U for unsigned integers.
Suggested by jan.mercl@nic.cz.

R=rsc, jnml
CC=golang-dev
https://golang.org/cl/4376054
2011-04-12 11:03:05 -07:00
Lucio De Re
11e07d23ed ld: ELF header function declarations.
Added "void" inside "()" for two functions.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4381056
2011-04-12 11:00:09 -07:00
Brad Fitzpatrick
92210eefb2 http: client gzip support
R=adg, rsc, bradfitzwork
CC=golang-dev
https://golang.org/cl/4389048
2011-04-12 09:35:07 -07:00
Gustavo Niemeyer
c34aadf063 openpgp: Fix improper := shadowing
R=golang-dev, agl1, jnml
CC=golang-dev
https://golang.org/cl/4381058
2011-04-12 11:48:05 -03:00
Nigel Tao
ce89a233a2 image/ycbcr: new package.
R=r, rsc, nigeltao_gnome
CC=golang-dev, raph
https://golang.org/cl/4374043
2011-04-12 22:32:03 +10:00
Nigel Tao
420a17e371 net: fix laddr typo in test code.
R=rsc
CC=golang-dev
https://golang.org/cl/4381050
2011-04-12 10:36:41 +10:00
Luuk van Dijk
0cc055e8f7 ld: fix dwarf decoding of strings for struct's fieldnames
Moved Sym printing to Yconv.
Fixed warning in data.c

R=rsc
CC=golang-dev
https://golang.org/cl/4378052
2011-04-11 16:38:37 -04:00
Robert Hencke
d36271a3e5 http: fix incorrect prints found by govet
R=golang-dev, bradfitzgo
CC=golang-dev
https://golang.org/cl/4370053
2011-04-11 13:05:08 -07:00
Fazlul Shahriar
8c1a703560 syscall: fix StartProcess in Plan 9
This makes os_test.TestStartProcess test from os package pass.

R=paulzhol, r2, r
CC=golang-dev
https://golang.org/cl/4385052
2011-04-11 12:39:53 -07:00
Mikkel Krautz
e2348deeec crypto/x509: expose complete DER data
R=agl1
CC=golang-dev
https://golang.org/cl/4376049
2011-04-11 11:20:12 -04:00
Luit van Drongelen
fe3dcfee27 asn1: Implement correct marshalling of length octets
Fixes #1683

R=agl1
CC=golang-dev, rsc
https://golang.org/cl/4367049
2011-04-11 10:28:34 -04:00
Dave Cheney
8b8b54ad5c net: disable multicast tests by default.
Fixes #1649.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/4343056
2011-04-11 10:39:21 +10:00
Dmitry Chestnykh
1b7142d157 archive/zip: add new type ReadCloser, make OpenReader return it.
Fixes #1678.

R=adg, rsc
CC=golang-dev
https://golang.org/cl/4372047
2011-04-10 11:23:23 +10:00
Russ Cox
1bc84b7e18 ld: 25% faster
The ld time was dominated by symbol table processing, so
  * increase hash table size
  * emit fewer symbols in gc (just 1 per string, 1 per type)
  * add read-only lookup to avoid creating spurious symbols
  * add linked list to speed whole-table traversals

Breaks dwarf generator (no idea why), so disable dwarf.

Reduces time for 6l to link godoc by 25%.

R=ken2
CC=golang-dev
https://golang.org/cl/4383047
2011-04-09 09:44:20 -04:00
Robert Griesemer
ebaf01f052 go/printer, gofmt: use blank to separate import rename from import path
Note that declarations.golden is not using spaces for alignment (so
that the alignment tabs are visible) which is why this change affects
the test cases significantly. gofmt uses spaces for alignment (by default)
and only tabs for indentation.

gofmt -w src misc (no changes)

Fixes #1673.

R=iant
CC=golang-dev
https://golang.org/cl/4388044
2011-04-08 15:47:21 -07:00
Adam Langley
8fc6703391 big: don't crash when printing nil ints
"%#v" of a structure with *big.Int's tends to crash a lot otherwise.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4382044
2011-04-08 15:43:19 -04:00
Russ Cox
23f6479be6 8g: optimize byte mov
Rewrite MOVB with less expensive
instruction when possible.

Suggested by atomic symbol.

benchmark                                        old ns/op    new ns/op    delta
crc32.BenchmarkCrc32KB                               13066         3942  -69.83%
crc64.BenchmarkCrc64KB                                8780         5949  -32.24%
lzw.BenchmarkDecoder1e4                             771224       636538  -17.46%
lzw.BenchmarkDecoder1e5                            7101218      6096634  -14.15%
lzw.BenchmarkDecoder1e6                           69762020     60789400  -12.86%
lzw.BenchmarkEncoder1e4                             707968       638812   -9.77%
lzw.BenchmarkEncoder1e5                            6567122      5965552   -9.16%
lzw.BenchmarkEncoder1e6                           65006000     58911680   -9.38%
utf8_test.BenchmarkRuneCountTenASCIIChars              166          165   -0.60%
utf8_test.BenchmarkRuneCountTenJapaneseChars           246          258   +4.88%
utf8_test.BenchmarkEncodeASCIIRune                      13           10  -23.08%
utf8_test.BenchmarkEncodeJapaneseRune                   37           16  -56.76%
utf8_test.BenchmarkDecodeASCIIRune                      23           21   -8.70%
utf8_test.BenchmarkDecodeJapaneseRune                   58           32  -44.83%

R=ken2
CC=golang-dev
https://golang.org/cl/4381045
2011-04-08 13:53:59 -04:00
Russ Cox
e7c4a6dfca gc: fix weird error message
Fixes #1670.

R=ken2
CC=golang-dev
https://golang.org/cl/4386045
2011-04-08 13:53:32 -04:00
Robert Hencke
8dc0ba7ae5 io: fixes for Read with n > 0, os.EOF
R=rsc
CC=golang-dev
https://golang.org/cl/4271080
2011-04-08 13:45:56 -04:00
Russ Cox
d26e73646e ld: fix arm build
R=ken2
CC=golang-dev, mikkel
https://golang.org/cl/4384048
2011-04-08 13:42:11 -04:00
Russ Cox
e6e2eb5807 http: do not listen on 0.0.0.0 during test
Quiets the pop-up boxes on OS X.

R=bradfitzgo, r2
CC=golang-dev
https://golang.org/cl/4387042
2011-04-08 13:04:29 -04:00
Rob Pike
ddd0fa1744 gotest: Fix fix for \r\n on windows.
R=rsc, brainman, rh, r2
CC=golang-dev
https://golang.org/cl/4366045
2011-04-08 09:50:20 -07:00
Russ Cox
db5c5d6fa6 update go tree for reflect changes
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4353043
2011-04-08 12:27:58 -04:00
Russ Cox
fb94eb1922 gofix: reflect changes
R=gri
CC=golang-dev
https://golang.org/cl/4343047
2011-04-08 12:27:24 -04:00
Russ Cox
877c1892bb gofix: add -diff, various fixes and helpers
* add -diff command line option
  * use scoping information in refersTo, isPkgDot, isPtrPkgDot.
  * add new scoping-based helpers countUses, rewriteUses, assignsTo, isTopName.
  * rename rewrite to walk, add walkBeforeAfter.
  * add toy typechecker, a placeholder for go/types

R=gri
CC=golang-dev
https://golang.org/cl/4285053
2011-04-08 12:27:08 -04:00
Russ Cox
fb175cf77e reflect: new Type and Value definitions
Type is now an interface that implements all the possible type methods.
Instead of a type switch on a reflect.Type t, switch on t.Kind().
If a method is invoked on the wrong kind of type (for example,
calling t.Field(0) when t.Kind() != Struct), the call panics.

There is one method renaming: t.(*ChanType).Dir() is now t.ChanDir().

Value is now a struct value that implements all the possible value methods.
Instead of a type switch on a reflect.Value v, switch on v.Kind().
If a method is invoked on the wrong kind of value (for example,
calling t.Recv() when t.Kind() != Chan), the call panics.

Since Value is now a struct, not an interface, its zero value
cannot be compared to nil.  Instead of v != nil, use v.IsValid().
Instead of other uses of nil as a Value, use Value{}, the zero value.

Many methods have been renamed, most due to signature conflicts:

           OLD                          NEW

    v.(*ArrayValue).Elem             v.Index
    v.(*BoolValue).Get               v.Bool
    v.(*BoolValue).Set               v.SetBool
    v.(*ChanType).Dir                v.ChanDir
    v.(*ChanValue).Get               v.Pointer
    v.(*ComplexValue).Get            v.Complex
    v.(*ComplexValue).Overflow       v.OverflowComplex
    v.(*ComplexValue).Set            v.SetComplex
    v.(*FloatValue).Get              v.Float
    v.(*FloatValue).Overflow         v.OverflowFloat
    v.(*FloatValue).Set              v.SetFloat
    v.(*FuncValue).Get               v.Pointer
    v.(*InterfaceValue).Get          v.InterfaceData
    v.(*IntValue).Get                v.Int
    v.(*IntValue).Overflow           v.OverflowInt
    v.(*IntValue).Set                v.SetInt
    v.(*MapValue).Elem               v.MapIndex
    v.(*MapValue).Get                v.Pointer
    v.(*MapValue).Keys               v.MapKeys
    v.(*MapValue).SetElem            v.SetMapIndex
    v.(*PtrValue).Get                v.Pointer
    v.(*SliceValue).Elem             v.Index
    v.(*SliceValue).Get              v.Pointer
    v.(*StringValue).Get             v.String
    v.(*StringValue).Set             v.SetString
    v.(*UintValue).Get               v.Uint
    v.(*UintValue).Overflow          v.OverflowUint
    v.(*UintValue).Set               v.SetUint
    v.(*UnsafePointerValue).Get      v.Pointer
    v.(*UnsafePointerValue).Set      v.SetPointer

Part of the motivation for this change is to enable a more
efficient implementation of Value, one that does not allocate
memory during most operations.  To reduce the size of the CL,
this CL's implementation is a wrapper around the old API.
Later CLs will make the implementation more efficient without
changing the API.

Other CLs to be submitted at the same time as this one
add support for this change to gofix (4343047) and update
the Go source tree (4353043).

R=gri, iant, niemeyer, r, rog, gustavo, r2
CC=golang-dev
https://golang.org/cl/4281055
2011-04-08 12:26:51 -04:00
Russ Cox
846a368b88 gofix: be more conservative about rewrite to os.Create
Rewrite only if we understood all the flags we saw.

R=r
CC=golang-dev
https://golang.org/cl/4376046
2011-04-08 10:59:25 -04:00
Alex Brainman
d976314776 gotest: handle \r\n returned by gomake on Windows (fixes build)
R=golang-dev, peterGo, rsc1
CC=Joe Poirier, golang-dev
https://golang.org/cl/4370048
2011-04-08 23:53:57 +10:00
Robert Griesemer
0ada4a2d62 go/types: fix build: use the right compiler to compile test case
R=rsc
CC=golang-dev
https://golang.org/cl/4369050
2011-04-07 22:10:39 -07:00
Robert Griesemer
1baffa7da0 gotype: use go/types GcImporter
R=rsc
CC=golang-dev
https://golang.org/cl/4358043
2011-04-07 21:42:30 -07:00
Robert Griesemer
a87382e7b3 go/types: New Go type hierarchy implementation for AST.
This CL defines a new, more Go-like representation of
Go types (different structs for different types as
opposed to a single Type node). It also implements
an ast.Importer for object/archive files generated
by the gc compiler tool chain. Besides the individual
type structs, the main difference is the handling of
named types: In the old world, a named type had a
non-nil *Object pointer but otherwise looked no
different from other types. In this new model, named
types have their own representation types.Name. As
a result, resolving cycles is a bit simpler during
construction, at the cost of having to deal with
types.Name nodes explicitly later. It remains to be
seen if this is a good approach. Nevertheless, code
involving types reads more nicely and benefits from
full type checking. Also, the representation seems
to more closely match the spec wording.

Credits: The original version of the gc importer was
written by Evan Shaw (chickencha@gmail.com). The new
version in this CL is based largely on Evan's original
code but contains bug fixes, a few simplifications,
some restructuring, and was adjusted to use the
new type hierarchy. I have added a comprehensive test
that imports all packages found under $GOROOT/pkg (with
a 3s time-out to limit the run-time of the test). Run
gotest -v for details.

The original version of ExportData (exportdata.go) was
written by Russ Cox (rsc@golang.org). The current version
is returning the internal buffer positioned at the beginning
of the export data instead of printing the export data to
stdout.

With the new types package, the existing in-progress
typechecker package is deprecated. I will delete it
once all functionality has been brought over.

R=eds, rog, rsc
CC=golang-dev
https://golang.org/cl/4314054
2011-04-07 21:40:37 -07:00
Robert Griesemer
70bf4215e9 scanner: better TokenString output
R=rsc
CC=golang-dev
https://golang.org/cl/4373048
2011-04-07 19:41:55 -07:00
Alex Brainman
776fd72579 test/bench: enable build and test on Windows
R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4366043
2011-04-08 10:43:25 +10:00
Alex Brainman
2683c76d95 misc/cgo/life: enable build and test on Windows
R=golang-dev, rsc1
CC=golang-dev, vcc
https://golang.org/cl/4374044
2011-04-08 10:35:35 +10:00
Alex Brainman
d3cd0c0752 syscall: fix Windows Signalled
Thanks to fhs.

R=golang-dev, r2
CC=ality, fhs, golang-dev
https://golang.org/cl/4375044
2011-04-08 10:27:47 +10:00
Russ Cox
35c880b1e2 gc: bug327
Fixes #1674.

R=ken2
CC=golang-dev
https://golang.org/cl/4368057
2011-04-07 18:53:47 -04:00
Russ Cox
62c24811e7 syscall: fix freebsd/386 again
TBR=r
CC=golang-dev
https://golang.org/cl/4380042
2011-04-07 15:44:10 -04:00
Russ Cox
62049366e7 syscall: freebsd/386 Syscall9 (fix build)
R=r
CC=golang-dev
https://golang.org/cl/4386042
2011-04-07 15:35:04 -04:00
Mikio Hara
c54ed66c75 syscall: fix build
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4368050
2011-04-07 12:03:45 -07:00
Mikkel Krautz
2aceea630f ld: fix Mach-O X86_64_RELOC_SIGNED relocations
Fixes #1658.

R=rsc
CC=golang-dev
https://golang.org/cl/4344066
2011-04-07 14:20:42 -04:00
Mikkel Krautz
cf3323f511 ld: fix Mach-O bss bug
Fixes #1559.

R=rsc
CC=golang-dev, peterGo, rog
https://golang.org/cl/4356046
2011-04-07 13:17:28 -04:00
Dave Cheney
b3a4d58ba8 syscall: fix typo in mmap comment
R=rsc
CC=golang-dev
https://golang.org/cl/4377043
2011-04-06 23:07:32 -04:00
Russ Cox
48ae1f2d9b syscall: add Mmap, Munmap on Linux, FreeBSD, OS X
* tweak mksyscall*.pl to be more gofmt-compatible.
* add mkall.sh -syscalls option.
* add sys/mman.h constants on OS X

R=r, eds, niemeyer
CC=golang-dev
https://golang.org/cl/4369044
2011-04-06 17:52:02 -04:00
Albert Strasheim
c45a08e5ba syscall: Add DT_* and MADV_* constants on Linux.
R=rsc, agl1
CC=golang-dev
https://golang.org/cl/4370041
2011-04-06 16:19:22 -04:00
Russ Cox
cf56f06ab6 os, syscall: refactor Unix directory parsing
Moved the details of how to read a directory
and how to parse the results behind the new
syscall functions ReadDirent and ParseDirent.

Now os needs just one copy of Readdirnames
for the three Unix variants, and it no longer
imports "unsafe".

R=r, r2
CC=golang-dev
https://golang.org/cl/4368048
2011-04-06 15:44:40 -04:00
Rob Pike
1e1e2f0971 exec: add a little package commentary explaining its
relationship to os.Process.

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4384041
2011-04-06 12:37:17 -07:00
Russ Cox
2671ddd10b fix build (sorry)
TBR=r
CC=golang-dev
https://golang.org/cl/4378042
2011-04-06 15:13:18 -04:00
Russ Cox
0ea7bf4867 src/pkg/Makefile: trim per-directory make output except on failure
Not committed to this but it sure makes
the output easier to skim.  With this CL:

$ make
install runtime
install sync/atomic
install sync
install unicode
install utf16
install syscall
install os
...
install ../cmd/govet
install ../cmd/goyacc
install ../cmd/hgpatch
$ make test
test archive/tar
test archive/zip
test asn1
test big
test bufio
...
test path
test path/filepath
TEST FAIL reflect
gotest
rm -f _test/reflect.a
6g -o _gotest_.6 deepequal.go type.go value.go
rm -f _test/reflect.a
gopack grc _test/reflect.a _gotest_.6
all_test.go:210: invalid type assertion: reflect.NewValue(tt.i).(*StructValue) (non-interface type reflect.Value on left)
all_test.go:217: cannot type switch on non-interface value v (type reflect.Value)
all_test.go:218: undefined: IntValue
all_test.go:221: cannot use 132 (type int) as type reflect.Value in function argument
all_test.go:223: cannot use 8 (type int) as type reflect.Value in function argument
all_test.go:225: cannot use 16 (type int) as type reflect.Value in function argument
all_test.go:227: cannot use 32 (type int) as type reflect.Value in function argument
all_test.go:229: cannot use 64 (type int) as type reflect.Value in function argument
all_test.go:231: undefined: UintValue
all_test.go:234: cannot use 132 (type int) as type reflect.Value in function argument
all_test.go:234: too many errors
gotest: "/Users/rsc/g/go/bin/6g -I _test -o _xtest_.6 all_test.go tostring_test.go" failed: exit status 1
make[1]: *** [test] Error 2
make: *** [reflect.test] Error 1

R=r, r2
CC=golang-dev
https://golang.org/cl/4343046
2011-04-06 15:06:28 -04:00
Rob Pike
5ee13c0d59 log: generalize getting and setting flags and prefix.
- used to be only for standard log, not for user-built.
- there were no getters.
Also rearrange the code a little so we can avoid allocating
a buffer on every call.  Logging is expensive but we should
avoid unnecessary cost.

This should have no effect on existing code.

R=rsc
CC=golang-dev
https://golang.org/cl/4363045
2011-04-06 11:48:03 -07:00
Adam Langley
41971434d1 crypto/rsa: add 3-prime support.
R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4365041
2011-04-06 14:11:56 -04:00
Adam Langley
057bdfe39d crypto/rsa: flip the CRT code over so that it matches PKCS#1
The CRT is symmetrical in the case of two variables and I picked a
different form from PKCS#1.

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4381041
2011-04-06 10:22:04 -04:00
Alex Brainman
7f7371e95b pkg/path: enable tests on Windows
Fixes #1107.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4374041
2011-04-06 16:45:20 +10:00
Andrew Gerrand
b44dbff8c8 http: allow override of Content-Type for ServeFile
R=bradfitz, bradfitzwork
CC=golang-dev
https://golang.org/cl/4368041
2011-04-06 14:52:42 +10:00
Adam Langley
360ab50a9b crypto/rsa: add support for precomputing CRT values.
This speeds up private key operations by 3.5x (for a 2048-bit
modulus).

R=golang-dev, r, rsc1
CC=golang-dev
https://golang.org/cl/4348053
2011-04-05 18:07:01 -04:00
Dmitry Chestnykh
9f1394d270 crypto/ecdsa, crypto/rsa: use io.ReadFull to read from random source.
R=golang-dev, agl1
CC=golang-dev
https://golang.org/cl/4316057
2011-04-05 17:11:31 -04:00
Rob Pike
63e28ae4ab gotest: fix windows build.
R=rsc
CC=golang-dev
https://golang.org/cl/4339055
2011-04-05 13:51:49 -07:00
Rob Pike
88a8ac08b9 gotest: fix a bug in error handling.
If the command couldn't be found, argv[0] would be wiped.
Also, fix a print statement not to refer to make - it was a vestige of a prior form.

R=rsc, gri
CC=golang-dev
https://golang.org/cl/4360048
2011-04-05 12:51:10 -07:00
Adam Langley
906b2e7679 crypto/des: cleanups
R=rsc
CC=golang-dev
https://golang.org/cl/4315050
2011-04-05 15:40:48 -04:00
Adam Langley
2db1769d7b crypto/block: remove deprecated package.
R=rsc
CC=golang-dev
https://golang.org/cl/4315051
2011-04-05 15:23:40 -04:00
Peter Mundy
b2bf14acd9 gotest: fixes for [^.]_test file pattern
R=rsc, r
CC=golang-dev
https://golang.org/cl/4339054
2011-04-05 11:49:44 -07:00
Russ Cox
de3aac609c gofix: don't rewrite O_APPEND opens
R=r, rog
CC=golang-dev
https://golang.org/cl/4364041
2011-04-05 11:12:02 -04:00
Yasuhiro Matsumoto
7098f3d442 crypto/des: new package providing implementations of DES and TDEA
Original code by Chris Lennert <cale...@gmail.com>

R=rsc, agl1
CC=golang-dev
https://golang.org/cl/4331054
2011-04-05 10:59:10 -04:00
Rob Pike
80c5ef9f31 os: fix windows build
R=brainman
CC=golang-dev
https://golang.org/cl/4308047
2011-04-04 23:57:08 -07:00
Rob Pike
8a90fd3c72 os: New Open API.
We replace the current Open with:
OpenFile(name, flag, perm) // same as old Open
Open(name) // same as old Open(name, O_RDONLY, 0)
Create(name) // same as old Open(name, O_RDWR|O_TRUNC|O_CREAT, 0666)

This CL includes a gofix module and full code updates: all.bash passes.
(There may be a few comments I missed.)

The interesting packages are:
        gofix
        os
Everything else is automatically generated except for hand tweaks to:
        src/pkg/io/ioutil/ioutil.go
        src/pkg/io/ioutil/tempfile.go
        src/pkg/crypto/tls/generate_cert.go
        src/cmd/goyacc/goyacc.go
        src/cmd/goyacc/units.y

R=golang-dev, bradfitzwork, rsc, r2
CC=golang-dev
https://golang.org/cl/4357052
2011-04-04 23:42:14 -07:00
Brad Fitzpatrick
6e4966eb7f http: ignore Transfer-Encoding on HEAD responses
Amazon S3 sends Transfer-Encoding "chunked"
on its 404 responses to HEAD requests for
missing objects.

We weren't ignoring the Transfer-Encoding
and were thus interpretting the subsequent
response headers as a chunk header from the
previous responses body (but a HEAD response
can't have a body)

R=rsc, adg
CC=golang-dev
https://golang.org/cl/4346050
2011-04-04 19:43:36 -07:00
Brad Fitzpatrick
243266f62e http: fix Transport connection re-use race
A connection shouldn't be made available
for re-use until its body has been consumed.

(except in the case of pipelining, which isn't
implemented yet)

This CL fixes some issues seen with heavy load
against Amazon S3.

Subtle implementation detail: to prevent a race
with the client requesting a new connection
before previous one is returned, we actually
have to call putIdleConnection _before_ we
return from the final Read/Close call on the
http.Response.Body.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/4351048
2011-04-04 19:22:47 -07:00
Mikio Hara
f3ad899a2d net: fix typo
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4315049
2011-04-05 11:35:16 +10:00
Gustavo Niemeyer
94e60061eb filepath: new Abs function
R=golang-dev, rsc1, peterGo, bsiegert, r, mattn
CC=golang-dev
https://golang.org/cl/4271057
2011-04-04 18:29:24 -07:00
Brad Fitzpatrick
7c9c4fc3a1 http: fix hanging bug with HEAD responses
The transport readLoop was waiting forever for the client to
read the non-existent body before proceeding to read the next
request.

R=rsc
CC=golang-dev
https://golang.org/cl/4357051
2011-04-04 16:58:11 -07:00
Brad Fitzpatrick
2be13a80c7 os: add Seek whence constants
R=r, r2, rsc1, rsc, jacek.masiulaniec
CC=golang-dev
https://golang.org/cl/4344062
2011-04-04 13:53:52 -07:00
Russ Cox
d3ca620baf gotest: fix build
TBR=r
CC=golang-dev
https://golang.org/cl/4351047
2011-04-04 16:35:40 -04:00
Rob Pike
60c4c3464b path/filepath.Glob: add an error return.
The error will only occur for invalid patterns, but without this
error path there is no way to know that Glob has failed due to
an invalid pattern.

R=rsc
CC=golang-dev
https://golang.org/cl/4346044
2011-04-04 13:09:34 -07:00
Evan Shaw
06ee80d6eb bufio: Write and WriteString cleanup
Write never writes less than the buffer size and WriteString takes advantage
of the copy built-in to improve write efficiency.

R=rsc, ality, rog
CC=golang-dev
https://golang.org/cl/4344060
2011-04-04 15:57:10 -04:00
Matt Jones
5fd0a74987 http: use upper case hex in URL escaping
According to RFC 3986: "For consistency, URI producers
and normalizers should use uppercase hexadecimal digits
for all percent-encodings."  Using lower case characters
makes it incompatible with Google APIs when signing OAuth requests.

R=golang-dev, rsc1, rsc
CC=golang-dev
https://golang.org/cl/4352044
2011-04-04 15:49:49 -04:00