* 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
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
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
- 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
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
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
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
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
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
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
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
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
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
Since Go code can deadlock, this lets a testsuite driver set a
time limit for the test to run. This is simple but imperfect,
in that it only catches deadlocks in Go code, not in the
runtime scheduler.
R=r, rsc, iant2
CC=golang-dev
https://golang.org/cl/4326048
Also fix a bug: precision was in terms of bytes; should be runes.
Fixes#1652.
R=rsc, bradfitzgo, r2, bradfitzwork
CC=golang-dev
https://golang.org/cl/4280086
doc.go contains the details. The short story:
- command line is passed to the binary
- a new flag, -file, is needed to name files
- known flags have the "test." prefix added for convenience.
- gotest-specific flags are trimmed from the command line.
The effect should be that most existing uses are unaffected,
the ability to name files is still present, and it's nicer to use.
The downside is a lot more code in gotest.
Also allow a test to be called just Test.
R=rsc, niemeyer, rog, r2
CC=golang-dev
https://golang.org/cl/4307049
also: minor fix to parser
Note: gotest won't run the gotype test yet until
it permits TestXXX functions where XXX is empty.
R=r
CC=golang-dev
https://golang.org/cl/4300053
- don't consume '\n' as part of line comment
(otherwise grammars where '\n' are tokens won't
see them after a line comment)
- permit line comments to end in EOF
R=r
CC=golang-dev
https://golang.org/cl/4277089
As a special case, multi-line raw strings (i.e., strings in `` quotes)
were not indented if they were the only token on a line. This heuristic
was meant to improve formatting for multi-line raw strings where sub-
sequent lines are not indented at the level of the surrounding code.
Multiple people have complained about this. Removing the heuristic
again because it makes the formatting more regular, easier to under-
stand, and simplifies the implementation.
- manual changes to ebnf/ebnf_test.go for readability
- gofmt -w src misc
Fixes#1643.
R=r, rsc
CC=golang-dev
https://golang.org/cl/4307045
I'm in two minds as to whether this should be a function of gotest.
Tests that can flake out like this should be rare enough that we
needn't add more mechanism.
R=r
CC=golang-dev
https://golang.org/cl/4335042
It was left in netFD.connect() by an oversight (as the name
implies, bind has no business being in connect). As a result
of this change and by only calling netFD.connect() when ra
isn't nil it becomes simpler with less code duplication.
Additionally, if netFD.connect() fails, set sysfd to -1 to
avoid finalizers (e.g. on windows) calling shutdown on a
closed and possibly reopened socket that just happened to
share the same descriptor.
R=golang-dev, rsc1, rsc
CC=golang-dev
https://golang.org/cl/4328043
It runs all tests correctly and saves significant time by avoiding the shell script.
However, this is just the code for the command, for review.
A separate CL will move this into the real gotest, which will take some dancing.
R=rsc, peterGo, bsiegert, albert.strasheim, rog, niemeyer, r2
CC=golang-dev
https://golang.org/cl/4281073
This changeset makes it possible for crypto/x509 to parse
certificates that include the 'Extended Key Usage' extension
with the critical bit set.
R=agl1
CC=golang-dev
https://golang.org/cl/4277075
* Adds support for GENERAL STRING
* Adds support for APPLICATION tagged values.
* Add UnmarshalWithParams to set parameters for the top-level
structure
R=golang-dev, rsc1, r
CC=golang-dev
https://golang.org/cl/4291075
Refactored bind/connect from sock.go into netFD.connect(), as
a consequence newFD() doesn't accept laddr/raddr anymore, and
expects an (optional) call to netFD.connect() followed by a
call to netFD.setAddr().
Windows code is updated, but still uses blocking connect,
since otherwise it needs support for ConnectEx syscall.
R=brainman, rsc
CC=golang-dev
https://golang.org/cl/4303060
Drop laddr argument from Dial.
Drop cname return from LookupHost.
Add LookupIP, LookupCNAME, ParseCIDR, IP.Equal.
Export SplitHostPort, JoinHostPort.
Add AAAA (IPv6) support to host lookups.
Preparations for implementing some of the
lookups using cgo.
ParseCIDR and IP.Equal are logically new in this CL
but accidentally snuck into an earlier CL about unused
labels that was in the same client.
In crypto/tls, drop laddr from Dial to match net.
R=golang-dev, dsymonds, adg, rh
CC=golang-dev
https://golang.org/cl/4244055
With gccgo some operating systems require using select rather
than epoll or kevent. Using select means that we have to wake
up the polling thread each time we add a new file descriptor.
This implements that in the generic code rather than adding
another wakeup channel, even though nothing in the current net
package uses the capability.
R=rsc, iant2
CC=golang-dev
https://golang.org/cl/4284069
NewPackage creates an ast.Package node from
a set of package files and resolves unresolved
identifiers.
Also:
- Changed semantics of Scope.Insert: If an
object is inserted w/o errors, the result
is nil (before it was obj).
- Fixed an identifier resolution bug in the
parser: map keys must not be resolved.
gotype runs through several go/* packages
and successfully resolves all (non-field/method)
identifiers.
R=rog, rsc
CC=golang-dev
https://golang.org/cl/4298044
in gdb, 'info goroutines' and 'goroutine <n> <cmd> were crashing
because the 'g' and 'm' structures had changed a bit.
R=rsc
CC=golang-dev
https://golang.org/cl/4289077
On darwin amd64 it was impossible to create more that ~132 threads. While
investigating I noticed that go consumes almost 1TB of virtual memory per
OS thread and the reason for such a small limit of OS thread was because
process was running out of virtual memory. While looking at bsdthread_create
I noticed that on amd64 it wasn't using PTHREAD_START_CUSTOM.
If you look at http://fxr.watson.org/fxr/source/bsd/kern/pthread_synch.c?v=xnu-1228
you will see that in that case darwin will use stack pointer as stack size,
allocating huge amounts of memory for stack. This change fixes the issue
and allows for creation of up to 2560 OS threads (which appears to be some
Mac OS X limit) with relatively small virtual memory consumption.
R=rsc
CC=golang-dev
https://golang.org/cl/4289075