Two tests start a goroutine which runs exportSend, and then
the tests run importReceive. exportSend creates an export
channel. importReceive asks to receive values on that
channel. Because exportSend runs in a separate goroutine,
it's possible for the export client to receive the request for
values on the channel, from importReceive, before the
goroutine actually creates the export channel. That causes an
error: "export: no such channel: exportedSend". This patch
avoids the race by creating the export channel before starting
the goroutine.
There does not seem to be a similar race condition in the
tests which send data in the other direction.
R=r
CC=golang-dev
https://golang.org/cl/2026045
- refine/define Scope, Object, and Type structures
(note: scope.go has the addition of types, the rest is only re-organized
for better readability)
- implemented top-level of type checker:
resolve global type declarations (deal with double decls, cycles, etc.)
- temporary hooks for checking of const/var declarations, function/method bodies
- test harness for fine-grained testing (exact error locations)
with initial set of tests
This is a subset of the code for easier review.
R=rsc
CC=golang-dev
https://golang.org/cl/1967049
Based on the observation that a great number of the types that
are copied or compared in interfaces, maps, and channels are
word-sized, this uses specialized copy and equality functions
for them that use a word instead of 4 or 8 bytes. Seems to yield
0-6% improvements in performance in the benchmarks I've run.
For example, with the regexp benchmarks:
Before:
regexp.BenchmarkLiteral 500000 3.26 µs/op
regexp.BenchmarkNotLiteral 100000 13.67 µs/op
regexp.BenchmarkMatchClass 100000 18.72 µs/op
regexp.BenchmarkMatchClass_InRange 100000 20.04 µs/op
regexp.BenchmarkReplaceAll 100000 27.85 µs/op
After:
regexp.BenchmarkLiteral 500000 3.11 µs/op
regexp.BenchmarkNotLiteral 200000 13.29 µs/op
regexp.BenchmarkMatchClass 100000 17.65 µs/op
regexp.BenchmarkMatchClass_InRange 100000 18.49 µs/op
regexp.BenchmarkReplaceAll 100000 26.34 µs/op
R=rsc
CC=golang-dev
https://golang.org/cl/1967047
This way, if you later want to check things in,
you can (with appropriate authorization).
Using plain http leads to the cryptic error
abort: HTTP Method Not Allowed.
R=r
CC=golang-dev
https://golang.org/cl/1983050
Commands written in Go depend on Go packages, so they
cannot be built by src/cmd/make.bash. They have been
built by src/make.bash after all the packages are done, but
we want to be able to use cgo (written in Go) during the build
of package net. To make this possible, build the commands
from src/pkg/Makefile instead of src/make.bash, so that they
are included in the package dependency analysis.
R=r
CC=golang-dev
https://golang.org/cl/1972046
Due to header key normalization/typo, the server never responds with
the protocol header in place. This breaks all (draft76) applications
that are using the protocol-header.
R=ukai, rsc
CC=golang-dev
https://golang.org/cl/1969046
Despite the name, URL escaping is for a small subpiece of the URL only.
This particular URL is being emitted in an <a href=""> tag and in that
context it should be HTML escaped, not URL escaped.
In addition to fixing a bug, this change cuts a dependency chain
from go/doc to net, clearing the way for use of cgo
(which imports go/doc) during the compilation of package net.
R=gri
CC=golang-dev
https://golang.org/cl/1960050
(Assumed to be in $PATH. all.bash ensures that
during the main build and the user must ensure it
when running commands like gotest or gomake
by hand. This belonged in the earlier CL but I missed it.)
R=r
CC=golang-dev
https://golang.org/cl/1967048
The runtime only passes 32 bits of file offset,
but the kernel wants 64 bits, so have to add
zeros explicitly in a copy of the arguments.
R=adg, Martin Neubauer
CC=golang-dev
https://golang.org/cl/1933044
Cannot use paren field in Node because all
instances of a given symbol name use the same Node.
Fixes#1022.
R=ken2
CC=golang-dev
https://golang.org/cl/2015043
Augmented ASTs may contain cycles. Keep
track of already printed objects and refer
to them with a line number instead of
printing them again.
R=rsc
CC=golang-dev
https://golang.org/cl/1998042
go/ast: implement Fprint and print functions to
print AST nodes
gofmt: print AST nodes by setting -ast flag
R=rsc, r
CC=golang-dev
https://golang.org/cl/1981044
Function to create a GoString with a known length so it can contain NUL
bytes anywhere in the string. Some C libraries have strings like this.
R=rsc
CC=golang-dev
https://golang.org/cl/2007042
(Argument: For any *PtrValue p, it should
always be possible to do: p.PointTo(p.Elem()),
even if p.Elem() is nil.)
Fixes#1028.
R=rsc
CC=golang-dev, r
https://golang.org/cl/1938044
tabwriter: Introduce a new flag StripEscape to control
if tabwriter.Escape chars should be stripped or passed
through unchanged.
go/printer: Don't modify tabwriter.Escape'd text. This
involved a new implementation of the internal trimmer
object.
Does not affect formatting of any existing code under
$GOROOT/src and $GOROOT/misc.
Fixes#1030.
R=rsc
CC=golang-dev
https://golang.org/cl/1943045
the solution must work around a weakness in the reflection library:
there is no way to do type-safe conversions under reflection.
R=rsc
CC=golang-dev
https://golang.org/cl/2000041
This changeset implements client certificate support in crypto/tls
for both handshake_server.go and handshake_client.go
The updated server implementation sends an empty CertificateAuthorities
field in the CertificateRequest, thus allowing clients to send any
certificates they wish. Likewise, the client code will only respond
with its certificate when the server requests a certificate with this
field empty.
R=agl, rsc, agl1
CC=golang-dev
https://golang.org/cl/1975042
- change ast.Ident back to contain the name and adjust all dependent code
- identifier object information will be added again through an optional
typechecker phase (in the works).
- remove tracking of scopes in parser - it's easier to do this in a separate
phase (in the works)
- in godoc, generate popup info table directly instead of through a formatter
for simpler data flow (at the expense of a little bit more code)
Runs all tests.
As a result of this change, the currently shown popup information
(const, var, type, func, followed by identifier name) will not be
shown anymore temporarily.
R=rsc
CC=golang-dev
https://golang.org/cl/1994041
draft-ietf-6man-text-addr-representation-07 will introduce
a canonical textual representation format for IPv6 address.
R=rsc
CC=golang-dev
https://golang.org/cl/1856047
Also, if the header is bad, exit with a non-zero status.
Other calls to Brdline in the tree, by category:
Reading symbol name from object file:
./cmd/5l/obj.c:486: name = Brdline(f, '\0');
./cmd/6l/obj.c:535: name = Brdline(f, '\0');
./cmd/8l/obj.c:564: name = Brdline(f, '\0');
./libmach/sym.c:292: cp = Brdline(bp, '\0');
Reading archive header line (fixed, short):
./cmd/gc/lex.c:287: if((a = Brdline(b, '\n')) == nil)
./cmd/gc/lex.c:303: if((p = Brdline(b, '\n')) == nil)
Reading object file header line (fixed, short):
./cmd/ld/lib.c:421: line = Brdline(f, '\n');
Reading undefined symbol list (unused code):
./cmd/ld/lib.c:773: while((l = Brdline(b, '\n')) != nil){
Implementing Brdstr:
./libbio/brdstr.c:36: p = Brdline(bp, delim);
The symbol names ones will cause a problem loudly if they
fail: they'll error out with symbol name too long. This means
that you can't define an enormous struct without giving the
type a name and then stick it in an interface, because the
type's symbol name will be too long for the object file.
Since this will be a loud failure instead of a silent one,
I'm willing to wait until it comes up in practice.
R=r
CC=golang-dev
https://golang.org/cl/1982041
The previous set was spotty, incomplete, and confusing.
This CL proposes a regular, clean set with clearer names.
It's also complete. Many existing methods will be deprecated,
but not in this CL. Ditto for the tests.
R=rsc, gri
CC=golang-dev, rog
https://golang.org/cl/1946041
go/scanner: return information on semicolon (real or inserted) when
found in source
go/parser: better error message when a semicolon is found unexpectedly
For instance, if an unexpected semicolon is found that was automatically
inserted, the parser error message is now:
"expected '}', found newline"
Fixes#1006.
R=rsc
CC=golang-dev
https://golang.org/cl/1936044
Fixes#971.
Parse/ParseFile methods of Template now match template.Parse and .ParseFile methods.
Also made tests being run on Parse and ParseFile be run on Template.ParseFile as well.
R=r
CC=golang-dev
https://golang.org/cl/1741059
Rect types.
The actual image representation is unchanged. A future change will
replace the {[][]color} with {[]color, stride int, r Rectangle} and
possibly a clip region.
The draw.Color, draw.Point and draw.Rect types will be removed in a
future change. Trying to do it in this one polluted the diff with
trivia.
R=r, rsc
CC=golang-dev
https://golang.org/cl/1918047
Fixed:
* SetString calls in bitwise tests
* Aliasing problem with self bitwise test
* One test case that was just flat out wrong
* Slice panics in nat.or and nat.xor
* Aliasing problems in Int.And, Int.AndNot, Int.Or, Int.Xor
Fixes#1007.
R=gri
CC=golang-dev
https://golang.org/cl/1895049
Generic text-based network protcol library for SMTP-like protocols.
HTTP and NNTP should be changed to use this package,
and I expect that SMTP and POP3 will be able to use it too.
R=cemeyer, nigeltao_golang, r
CC=golang-dev, petar-m
https://golang.org/cl/889041
Basically these functions are implemented the same way as the
corresponding functions in the strings package. Test functions
are implemented for IndexRune and FieldsFunc.
Additionally two typos are fixed in packages bytes and strings.
R=r
CC=golang-dev
https://golang.org/cl/1696062
Returns R14 and R15 to the available register pool.
Plays more nicely with ELF ABI C code.
In particular, our signal handlers will no longer crash
when a signal arrives during execution of a cgo C call.
Fixes#720.
R=ken2, r
CC=golang-dev
https://golang.org/cl/1847051
- don't allow parenthesized receiver base types or anonymous fields
- fixed a couple of other omissions
- adjusted gofmt test script
- removed several TODOs
R=rsc
CC=golang-dev
https://golang.org/cl/1897043
Besides being more correct, it protects against people accidentally
exchanging the permission and open mode arguments to Open.
R=rsc
CC=golang-dev
https://golang.org/cl/1904045
RFC 5280, 4.2.1.2 says:
SubjectKeyIdentifier ::= KeyIdentifier
KeyIdentifier ::= OCTET STRING
Previously, we were failing to unwrap the second level of OCTET STRING
encoding.
Fixes#993.
R=rsc
CC=golang-dev
https://golang.org/cl/1917044
Fixes#980.
Made it return an empty array, rather than crash.
Added relevant test cases to strings.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/1914041
Goroutine 1:
Call Read on read half of pipe, entering pipeHalf.rw.
Check ioclosed field, which is false.
Send data to p.c1
Wait for response on p.c2.
Goroutine 2:
Call Close on read half of pipe, entering pipeHalf.close.
Set closed field.
Send error to p.cclose.
Set ioclosed field.
Send 1 to p.done.
Return and exit goroutine.
Goroutine 3:
This is the goroutine running pipe.run, and for some reason
it has started late.
Read error from p.rclose; set rerr and continue.
Read 1 from p.done; increment ndone and continue.
Read data from r1 (sent by goroutine 1); set r1 = nil and continue
Now goroutine 1 is waiting for a response, and goroutine 3 is
waiting for something else to happen.
This patch fixes the race by having the runner check whether
the read half is closed when it is asked for read data, and
similarly for the corresponding race on the write half.
This patch also fixes the similar race in which ndone gets
bumped up to 2 while there is a reader or writer waiting.
There is still another race to fix. It is possible for the
read half and the write half to both be closed, and for the
runner goroutine to exit, all before the runner goroutine sees
the request from a reader. E.g., in the above, have goroutine
2 also close the write half, and have goroutine 3 see both
done messages before it sees the request from goroutine 1.
R=rsc
CC=golang-dev
https://golang.org/cl/1862045
For the Windows version of syscall Errstr, set the
FORMAT_MESSAGE_IGNORE_INSERTS value of the FormatMessage
Flags argument when there are no values to insert.
R=rsc, brainman
CC=golang-dev
https://golang.org/cl/1868043
SNI (Server Name Indication) is a way for a TLS client to
indicate to the server which name it knows the server by. This
allows the server to have several names and return the correct
certificate for each (virtual hosting).
PeerCertificates returns the list of certificates presented by
server.
R=r
CC=golang-dev
https://golang.org/cl/1741053
OCSP is the preferred X.509 revocation mechanism. X.509 certificates
can contain a URL from which can be fetched a signed response saying
"this certificate is valid until $x" (where $x is usually 7 days in the
future). These are called OCSP responses and they can also be included
in the TLS handshake itself ("OCSP stapling")
R=rsc, r
CC=golang-dev
https://golang.org/cl/1875043
- don't lose empty lines after labels
- canonicalize number of line breaks
- gofmt src misc, fixes a couple of irregular breaks
R=rsc
CC=golang-dev
https://golang.org/cl/1843044
but with less precision than hardware counterparts.
fixed a number of tests to output BUG when they failed.
changed the runner to distinghuish between output
and output containing ^BUG
R=rsc
CC=dho, golang-dev
https://golang.org/cl/1778041
strings.ToTitle converts all characters to title case, which for consistency with the
other To* functions it should continue to do. This CL adds string.Title, which
does a proper title-casing of the string.
A similar function for package bytes will follow once this is settled.
Fixes#933.
R=rsc
CC=golang-dev
https://golang.org/cl/1869042
Add support for ASN.1 ENUMERATED types.
Add a magic type, asn1.Flag, for the cases where the presence of an
empty explicit tag is semantically meaningful.
Add support for GeneralizedTime.
R=rsc
CC=golang-dev
https://golang.org/cl/1684055
out of floating constant multiply
2. added rounding code to "const fix=float"
to allow up to 29 (Mpscale) bits of
slop and still get an exact fixed constant.
fixes#931
R=rsc
CC=golang-dev
https://golang.org/cl/1692055
//line 10 units.y
which is equiv to c
#line 10 units.y
the purpose is to generate diagnostics
that correctly point to preprocessed source.
R=rsc
CC=golang-dev
https://golang.org/cl/1863042
Somewhat of a work-in-progress (in that MIME is a large spec), but this is
functional and enough for discussion and/or code review.
In addition to the unit tests, I've tested with curl and Chrome with
a variety of test files, making sure the digests of files are unaltered
when read via a multipart Part.
R=rsc, adg, dsymonds1, agl1
CC=golang-dev
https://golang.org/cl/1681049
* remember #defined names, so that C.stdout can refer
to the real name (on OS X) __stdoutp.
* better handling of #defined constant expressions
* allow n, err = C.strtol("asdf", 0, 123) to get errno as os.Error
* write all output files to current directory
* don't require gcc output if there was no input
Fixes#533.
Fixes#709.
Fixes#756.
R=r
CC=dho, golang-dev, iant
https://golang.org/cl/1734047
Also in this CL:
* Removed util.go, as its functionality is in big
* Removed some semicolons from the code generated by gen.go
* Added a generate target to Makefile
* Removed an outdated TODO from value.go
R=gri
CC=golang-dev
https://golang.org/cl/1780042