Thanks to Andrey Mirtchovski for tracking this down.
This was broken by CL 5528077 which removed the InsertSemis
flag from go/scanner - as a result, semicolons are now always
inserted and the respective indexer code checked for the
wrong token.
Replaced the code by a direct identifier test.
R=rsc
CC=golang-dev
https://golang.org/cl/5606065
The go- is redundant now that the directory is required
to be inside $GOROOT. Rob LGTMed the idea.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5618044
This reduces the overhead necessary to work with OS-specific
file details, hides the implementation of FileStat, and
preserves the implementation-specific nature of Sys.
Expressions such as:
stat.(*os.FileInfo).Sys.(*syscall.Stat_t).Uid
fi1.(*os.FileStat).SameFile(fi2.(*os.FileStat))
Are now spelled as::
stat.Sys().(*syscall.Stat_t).Uid
os.SameFile(fi1, fi2)
R=cw, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5448079
dist is short for distribution. This is the new Go distribution tool.
The plan is to replace the Makefiles with what amounts to
'go tool dist bootstrap', although it cannot be invoked like
that since it is in charge of getting us to the point where we
can build the go command.
It will also add additional commands to replace bash scripts
like test/run (go tool dist testrun), eventually eliminating our
dependence on not just bash but all the Unix tools and all
of cygwin.
This is strong enough to build (cc *.c) and run (a.out bootstrap)
to build not just the C libraries and tools but also the basic
Go packages up to the bootstrap form of the go command
(go_bootstrap). I've run it successfully on both Linux and Windows.
This means that once we've switched to this tool in the build,
we can delete the buildscripts.
This tool is not nearly as nice as the go tool. There are many
special cases that turn into simple if statements or tables in
the code. Please forgive that. C does not enjoy the benefits
that we designed into Go.
I was planning to wait to do this until after Go 1, but the
Windows builders are both broken due to a bug in either
make or bash or both involving the parsing of quoted command
arguments. Make thinks it is invoking
quietgcc -fno-common -I"c:/go/include" -ggdb -O2 -c foo.c
but bash (quietgcc is a bash script) thinks it is being invoked as
quietgcc -fno-common '-Ic:/go/include -ggdb' -O2 -c foo.c
which obviously does not have the desired effect. Rather than fight
these clumsy ports, I accelerated the schedule for the new tool.
We should be completely off cygwin (using just the mingw gcc port,
which is much more standalone) before Go 1.
It is big for a single CL, and for that I apologize. I can cut it into
separate CLs along file boundaries if people would prefer that.
R=golang-dev, adg, gri, bradfitz, alex.brainman, dsymonds, iant, ality, hcwfrichter
CC=golang-dev
https://golang.org/cl/5620045
The change to -m is the only one necessary
to close the issue. The others are useful
to know about when debugging but shouldn't
be in the usage message since they may go
away or change at any time.
Fixes#2802.
R=lvd, rsc
CC=golang-dev
https://golang.org/cl/5606046
This patch adds a function to get the current cpu ticks. This is
deemed to be 'sufficiently random' to use to seed fastrand to mitigate
the algorithmic complexity attacks on the hash table implementation.
On AMD64 we use the RDTSC instruction. For 386, this instruction,
while valid, is not recognized by 8a so I've inserted the opcode by
hand. For ARM, this routine is currently stubbed to return a constant
0 value.
Future work: update 8a to recognize RDTSC.
Fixes#2630.
R=rsc
CC=golang-dev
https://golang.org/cl/5606048
- Unified bounary conditions for NFC and NFD and removed some indirections.
This enforces boundaries at the character level, which is typically what
the user expects. (NFD allows a boundary between 'a' and '`', for example,
which may give unexpected results for collation. The current implementation
is already stricter than the standard, so nothing much changes. This change
just formalizes it.
- Moved methods of qcflags to runeInfo.
- Swapped YesC and YesMaybe bits in qcFlags. This is to aid future changes.
- runeInfo return values use named fields in preperation for struct change.
- Replaced some left-over uint32s with rune.
R=r
CC=golang-dev
https://golang.org/cl/5607050
Without this change, fd3 can be collected by the garbage
collector and finalized, which causes the file descriptor to
be closed, which causes the call to os.Open to return 3 rather
than the expected descriptor number.
R=golang-dev, gri, bradfitz, bradfitz, iant
CC=golang-dev
https://golang.org/cl/5607056
The rule is that build directives can be preceded only
by blank lines and other line comments, not /* */ comments.
R=golang-dev, adg, bradfitz
CC=golang-dev
https://golang.org/cl/5619045
This is a minimal API extension, it makes it possible
to implement missing Int functionality externally w/o
compromising efficiency. It is the hope that this will
reduce the number of feature requests going directly
into the big package.
Also: Fixed some naming inconsistencies: The receiver
is only called z when it is also the result.
R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/5607055
This will add the temporary object directory into the lookup
path so that cgo-exported function declarations may be
included from C files.
This was previously applied by CL 5600043, and apparently
removed by mistake on CL 5598045.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5610054
This can happen on Plan 9 if we we're building
with the 32-bit and 64-bit host compilers, one
after the other.
R=rsc
CC=golang-dev
https://golang.org/cl/5599053
Plan 9's tr(1) doesn't accept the C-style escapes
for tab and newline characters. I was going to use
the \xFF hexadecimal escapes but GNU tr(1) doesn't
accept those. It seems octal is the least common
denominator.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5576079
This can drastically reduce the number of system
calls made by programs that repeatedly query the
environment.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5599054
Ignore result of setting SO_BROADCAST.
Disable TestSimpleListenMulticastUDP as
setIPv4MulticastInterface is not implemented.
R=golang-dev, bradfitz, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/5610044
Print all the syntax errors. Fixes issue 2811.
Change Windows binary removal strategy.
This should keep the temporary files closer to
the binaries they are for, which will make it
more likely that the rename is not cross-device
and also make it easier to clean them up.
Fixes#2604 (as much as we can).
The standard build does not use the go command
to install the go command anymore, so issue 2604
is less of a concern than it originally was.
(It uses the go_bootstrap command to install
the go command.)
Buffer 'go list' output.
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5604048
Black box test is too time-consuming, as the bug
does not appear until Scan has processed 2 GB of
input in total across multiple calls, so no test.
Thanks to Frederick Mayle for the diagnosis and fix.
Fixes#2809.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5611043
Both are unused and undocumented.
InvalidConnError is also non-idiomatic: a FooError type can
typically describe something, else it would be an ErrFoo
variable.
R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/5609045
Do not treat $GOROOT/src/pkg, $GOROOT/src/cmd,
$GOPATH/src as package directories (only subdirectories
of those can be package directories). Fixes issue 2602.
Accept additional compiler and linker arguments during
cgo from $CGO_CFLAGS and $CGO_LDFLAGS, as the
Makefiles used to do.
Show failed pkg-config output. Fixes issue 2785.
Use different (perhaps better) git commands. Fixes issue 2109.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5605045
The type being unavailable on Windows was the only API
signature difference in the net package.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5608043
Print build errors to stderr during 'go run'.
Stream test output during 'go test' (no args). Fixes issue 2731.
Add go test -i to install test dependencies. Fixes issue 2685.
Fix data race in exitStatus. Fixes issue 2709.
Fix tool paths. Fixes issue 2817.
R=golang-dev, bradfitz, n13m3y3r, r
CC=golang-dev
https://golang.org/cl/5591045
The previous logic was mainly non-working. It only needs to
ensure that the go tool doesn't try to build the standard
library with gccgo.
R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/5580051
- enable AllMethods flag (default: not set)
- fix logic determining which methods to show
- added respective test case in testdata/e.go for AllMethods = false
- added test case set for AllMethods = true
The critical changes/files to look at are:
- testdata/e{0,1,2}.golden: T4.M should only show up as method of T5 in e2.golden
- reader.go: always include top-level methods, and negate former logic for embedded methods
(rewrote as a switch for better comprehensability)
Fixes#2791.
R=rsc, rsc
CC=golang-dev
https://golang.org/cl/5576057
This fixes some test noise in TestStressSurpriseServerCloses when
ulimit -n something low, like 256 on a Mac.
Previously, when the server closed on us and we were expecting more
responses (like we are in that test), we'd read an "Unexpected EOF"
and just forget about the client's net.Conn. Now it's closed,
rather than waiting on the finalizer to release the fd.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5602043
I missed an overflow in contract because I suspected that the prime
elimination would take care of it. It didn't, and I forgot to get back
to the overflow. Because of this, p224Contract may have produced a
non-minimal representation, causing flakey failures ~0.02% of the
time.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5592045
This CL introduces new function ListenMulticastUDP to fix
multicast UDP listening across multiple listeners issue,
to replace old multicast methods JoinGroup and LeaveGroup
on UDPConn.
This CL also enables multicast testing by default.
Fixes#2730.
R=rsc, paul.a.lalonde, fullung, devon.odell
CC=golang-dev
https://golang.org/cl/5562048
We support SSLv3 as a server but not as a client (and we don't want to
support it as a client). This change fixes the error message when
connecting to an SSLv3 server since SSLv3 support on the server side
made mutualVersion accept SSLv3.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5545073
5l -v is for benchmarking various parts of the loader, but this code in
obj.c will clutter the output. I only comment them out, because this is
on par with 8l/6l.
R=golang-dev
CC=golang-dev
https://golang.org/cl/5600046
A go build currently generates around 400MB of test output prior to
cleaning up. With this change we use a maximum of ~15MB.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5588044
Ensure that file descriptors have not already been leaked into our
environment - close any that are open at the start of the
TestExtraFiles test.
Also use the appropriate command for listing open files.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5574062
This patch adds a hash seed to the Hmap struct. Each seed is
initialized by runtime.fastrand1(). This is the first step of a
solution to issue 2630. Fastrand1 still needs to be updated to provide
us with actually random bits.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5599046
The new cross-compiling bin target was breaking
everything but the system where buildscript.sh ran.
TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5598055
Consequently, remove many package Makefiles,
and shorten the few that remain.
gomake becomes 'go tool make'.
Turn off test phases of run.bash that do not work,
flagged with $BROKEN. Future CLs will restore these,
but this seemed like a big enough CL already.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5601057
Add 'go clean'.
Make 'go build' write to pkgname, not a.out.
Make 'go test -c' write to pkgname.test, not test.out.
Make 'go install' write alternate binaries to .../bin/goos_goarch/.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5600048
We weren't properly deleting the various header
files (that were temporarily renamed) if a $CC
for the current $GOARCH didn't exist. And since
the compiler checks the current directory for
headers before any -I arguments, this had the
unfortunate side effect of including the last
generated headers instead of the correct ones.
R=r, rsc
CC=golang-dev
https://golang.org/cl/5581055
Also delete gotest, since it's messy to fix and slated for deletion anyway.
A couple of things outside src can't be tested any more. "go test" will be
fixed and these tests will be re-enabled. They're noisy for now.
Fixes#284.
R=rsc
CC=golang-dev
https://golang.org/cl/5598049
If set, all methods are shown, not just those
of non-exported anonynous fields.
This change will only become functional once
CL 5576057 is submitted.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5599048
This fixes a regression that was made when adding
support for building with gccgo (in d6a14e6fac0c).
External commands (those not from the Go tree) were
being installed to the package directory instead of
the binary directory.
R=golang-dev, rsc, adg, remyoudompheng, rsc
CC=golang-dev
https://golang.org/cl/5564072
This will add the temporary object directory into the lookup
path so that cgo-exported function declarations may be
included from C files.
R=golang-dev, rogpeppe, rsc
CC=golang-dev
https://golang.org/cl/5600043
Cookies recieved in a response to a POST request are stored
in the client's jar like they are for GET requests.
R=golang-dev, rsc
CC=bradfitz, golang-dev
https://golang.org/cl/5576065
fix, vet
yacc is also fixed (it was wrong before)
All that's left is the commands used during compilation
This looks like a huge CL, but it's almost all file renames.
The action is in cmd/go/pkg.go, the Makefiles, and .../doc.go.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5595044
If the argument to go fix isn't a package directory, the message said nothing helpful.
Now it at least says a package couldn't be found.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5577072
1) create go-tool dir in make.bash
2) clean up stale binaries in make.bash
3) add 'tool' command to go
4) convert goyacc->yacc as a first test tool
Since goyacc stands alone, it's a safe trial.
R=rsc
CC=golang-dev
https://golang.org/cl/5576061
They're not portable, and pkg os is supposed to be portable.
Fixes#2562
R=golang-dev, mikioh.mikioh, r, n13m3y3r, rsc
CC=golang-dev
https://golang.org/cl/5574078
Added flag AllMethods: if not set (future default), embedded
methods of exported (and thus visible) embedded fields are not
shown in the final package documentation
The actual change for AllMethods is just in sortedFuncs. All
other changes are simplifications of the existing logic (mostly
deletion of code): Because method conflicts due to embedding
must always be detected, remove any premature elimination of
types and methods. Instead collect all named types and all
methods and do the filtering at the end.
Miscellaneous:
- renamed baseType -> namedType
- streamline logic for recording embedded types
- record embedded types via a map (simpler data structures)
AllMethods is set by default; so the output is unchanged and
the tests pass. The next CL will enable the AllMethods flag
and have adjusted tests (and fix issue 2791).
R=rsc
CC=golang-dev
https://golang.org/cl/5572076
The use of gccgo is triggered by GC=gccgo in environment. It
still needs the standard distribution to behave properly, but
allows using the test, build, run, install subcommands with
gccgo.
R=rsc, iant, fullung
CC=golang-dev, remy
https://golang.org/cl/5562045
+eliminates a possibility of sending a call to Done several times.
+fixes memory leak in case of temporal Write errors.
+fixes data race on Client.shutdown.
+fixes data race on Client.closing.
+fixes comments.
Fixes#2780.
R=r, rsc
CC=golang-dev, mpimenov
https://golang.org/cl/5571063
This solves the ambiguity for "lp.net/project/foo". In these URLs,
"foo" could be a series name registered in Launchpad with its own
branch, and it could also be the name of a directory within the
main project branch one level up.
Solve it by testing if the series branch exists in Launchpad
and if it doesn't moving the root one level up.
R=rsc
CC=golang-dev
https://golang.org/cl/5577058
The new url.URL's parsing can be too canonicalizing for
certain applications. By keeping the original request URI
around, we give applications a gross escape hatch while
keeping the URL package clean and simple for normal uses.
(From a discussion with Gary Burd, Gustavo Niemeyer,
and Russ Cox.)
Fixes#2782
R=golang-dev, rsc, dsymonds
CC=golang-dev
https://golang.org/cl/5580044
It means serious user error that can lead to
hard to debug issues under load, log entry
will not harm.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5574075
The idea is that we add files to the api/ directory which
are sets of promises for the future. Each line in a file
is a stand-alone feature description.
When we do a release, we make sure we haven't broken or changed
any lines from the past (only added them).
We never change old files, only adding new ones. (go-1.1.txt,
etc)
R=dsymonds, adg, r, remyoudompheng, rsc
CC=golang-dev
https://golang.org/cl/5570051
Separating Method from Func made the code only more complicated
without adding much to the useability/readability of the API.
Reverted to where it was, but leaving the new method-specific
fields Orig and Level.
Former clients (godoc) of doc.Method only used the Func fields;
and because Func was embedded, no changes are needed with respect
to the removal of Method.
Changed type of Func.Recv from ast.Expr to string. This was a
long-standing TODO. Also implemented Func.Orig field (another TODO).
No further go/doc API changes are expected for Go 1.
R=rsc, r, r
CC=golang-dev
https://golang.org/cl/5577043
This improves the handling of xml.Unmarshal in
the xmlapi fix by guessing some of the common
types used on it.
This also fixes a bug in the partial typechecker.
In an expression such as f(&a), it'd mark a as
having &T rather than *T.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5572058
Pulling function calls out to happen before the
expression being evaluated was causing illegal
reorderings even without inlining; with inlining
it got worse. This CL adds a separate ordering pass
to move things with a fixed order out of expressions
and into the statement sequence, where they will
not be reordered by walk.
Replaces lvd's CL 5534079.
Fixes#2740.
R=lvd
CC=golang-dev
https://golang.org/cl/5569062
Added a cache to compensate for extra call overhead.
go test -bench=Print marginally faster (in the noise).
R=r
CC=golang-dev
https://golang.org/cl/5574061
The implementation is divided into 4 phases:
1) export filtering of an incoming AST if necessary (exports.go)
2) reading of a possibly filtered AST (reader.go: type reader)
3) method set computation (reader.go)
4) sorting and creation of final documentation (reader.go)
In contrast to the old implementation, the presentation data
(Names, Docs, Decls, etc.) are created immediately upon reading
the respective AST node. Also, all types are collected (embedded
or not) in a uniform way.
Once the entire AST has been processed, all methods and types
have been collected and the method sets for each type can be
computed (phase 3).
To produce the final documentation, the method sets and value
maps are sorted.
There are no API changes. Passes the existing test suite unchanged.
R=rsc, rogpeppe
CC=golang-dev
https://golang.org/cl/5554044
Reimplement the test based on code from adg@golang.org.
The previous version has a race since the file is closed via defer
rather than in the go routine. This meant that the file could be
closed before the go routine has actually received io.EOF. It then
receives EBADF and continues to do zero-byte writes to the pipe.
This addresses an issue seen on FreeBSD and OpenBSD, where the test
passes but exits with a SIGPIPE, resulting in a failure.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5554083
Without this change it's possible to launch godoc,
immediately GET /, and see a directory listing instead of root.html
R=gri
CC=golang-dev
https://golang.org/cl/5575054
work in progress, and we are not ready to freeze its API for Go 1.
Package html still exists, containing just two functions: EscapeString
and UnescapeString.
Both the packages at exp/html and html are "package html". The former
is a superset of the latter.
At some point in the future, the exp/html code will move back into
html, once we have finalized the parser API.
R=rsc, dsymonds
CC=golang-dev
https://golang.org/cl/5571059
Marshaler has a number of open areas that need
further thought (e.g. it doesn't handle attributes,
it's supposed to handle tag names internally but has
no information to do so, etc).
We're removing it now and will bring it back with an
interface that covers these aspects, after Go 1.
Related to issue 2771, but doesn't fix it.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5574057
In order to allow buildscript.sh to generate buildscripts for all
$GOOS/$GOARCH combinations, we have to generate dummy files for cmd/go.
Fixes#2586.
R=rsc, golang-dev
CC=golang-dev
https://golang.org/cl/5557050
Also, add an explicit error type when the right hand side is an unexported
function.
R=golang-dev, gri, rogpeppe, agl, rsc
CC=golang-dev
https://golang.org/cl/5564048
Includes gofix module. The only case not covered should be
xml.Unmarshal, since it remains with a similar interface, and
would require introspecting the type of its first argument
better.
Fixes#2626.
R=golang-dev, rsc, gustavo
CC=golang-dev
https://golang.org/cl/5574053
CL 5572043 removed the last uses of this field.
The information is readily available from Type.Decl.
R=rsc, golang-dev
CC=golang-dev
https://golang.org/cl/5570049
The bitLen function currently shifts out blocks of 8 bits at a time.
This change replaces this sorta-linear algorithm with a log(N)
one (shift out 16 bits, then 8, then 4, then 2, then 1).
I left the start of it linear at 16 bits at a time so that
the function continues to work with 32 or 64 bit values
without any funkiness.
The algorithm is similar to several of the nlz ("number of
leading zeros") algorithms from "Hacker's Delight" or the
"bit twiddling hacks" pages.
Doesn't make a big difference to the existing benchmarks, but
I'm using the code in a different context that calls bitLen
much more often, so it seemed worthwhile making the existing
codebase faster so that it's a better building block.
Microbenchmark results on a 64-bit Macbook Pro using 6g from weekly.2012-01-20:
benchmark old ns/op new ns/op delta
big.BenchmarkBitLen0 4 6 +50.12%
big.BenchmarkBitLen1 4 6 +33.91%
big.BenchmarkBitLen2 6 6 +3.05%
big.BenchmarkBitLen3 7 6 -19.05%
big.BenchmarkBitLen4 9 6 -30.19%
big.BenchmarkBitLen5 11 6 -42.23%
big.BenchmarkBitLen8 16 6 -61.78%
big.BenchmarkBitLen9 5 6 +18.29%
big.BenchmarkBitLen16 18 7 -60.99%
big.BenchmarkBitLen17 7 6 -4.64%
big.BenchmarkBitLen31 19 7 -62.49%
On an ARM machine (with the previous weekly):
benchmark old ns/op new ns/op delta
big.BenchmarkBitLen0 37 50 +36.56%
big.BenchmarkBitLen1 59 51 -13.69%
big.BenchmarkBitLen2 74 59 -20.40%
big.BenchmarkBitLen3 92 60 -34.89%
big.BenchmarkBitLen4 110 59 -46.09%
big.BenchmarkBitLen5 127 60 -52.68%
big.BenchmarkBitLen8 181 59 -67.24%
big.BenchmarkBitLen9 78 60 -23.05%
big.BenchmarkBitLen16 199 69 -65.13%
big.BenchmarkBitLen17 91 70 -23.17%
big.BenchmarkBitLen31 210 95 -54.43%
R=golang-dev, dave, edsrzf, gri
CC=golang-dev
https://golang.org/cl/5570044
Move error information into Package struct, so that
a package can be returned even if a dependency failed
to load or did not exist. This makes it possible to run
'go fix' or 'go fmt' on packages with broken dependencies
or missing imports. It also enables go get -fix.
The new go list -e flag lets go list process those package
errors as normal data.
Change p.Doc to be first sentence of package doc, not
entire package doc. Makes go list -json or
go list -f '{{.ImportPath}} {{.Doc}}' much more reasonable.
The go tool now depends on http, which means also
net and crypto/tls, both of which use cgo. Trying to
make the build scripts that build the go tool understand
and handle cgo is too much work. Instead, we build
a stripped down version of the go tool, compiled as go_bootstrap,
that substitutes an error stub for the usual HTTP code.
The buildscript builds go_bootstrap, go_bootstrap builds
the standard packages and commands, including the full
including-HTTP-support go tool, and then go_bootstrap
gets deleted.
Also handle the case where the buildscript needs updating
during all.bash: if it fails but a go command can be found on
the current $PATH, try to regenerate it. This gracefully
handles situations like adding a new file to a package
used by the go tool.
R=r, adg
CC=golang-dev
https://golang.org/cl/5553059
This lets the client of go/build specify additional tags that
can be recognized in a // +build directive. For example,
a build for a custom environment like App Engine might
include "appengine" in the BuildTags list, so that packages
can be written with some files saying
// +build appengine (build only on app engine)
or
// +build !appengine (build only when NOT on app engine)
App Engine here is just a hypothetical context. I plan to use
this in the cmd/go sources to distinguish the bootstrap version
of cmd/go (which will not use networking) from the full version
using a custom tag. It might also be useful in App Engine.
Also, delete Build and Script, which we did not end up using for
cmd/go and which never got turned on for real in goinstall.
R=r, adg
CC=golang-dev
https://golang.org/cl/5554079
Golden files have extension .d.golden where d is the mode value (0 or 1 for now)
(i.e., testdata/file.out is now testdata/file.0.golden, and there is a new file
testdata/file.1.golden for each testcase)
R=rsc
CC=golang-dev
https://golang.org/cl/5573046
Marshalling of []byte in attributes and the general
marshalling of named []byte types was fixed.
A []byte field also won't be nil if an XML element
was mapped to it, even if the element is empty.
Tests were introduced to make sure that *struct{}
fields works correctly for element presence testing.
No changes to the logic made in that regard.
R=rsc
CC=golang-dev
https://golang.org/cl/5539070
It was 2^31, but that could cause overflow and trouble.
Reduce it to 2^30 and add a TODO.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5562049
It takes too much memory to be reliable and causes
trouble on 32-bit machines.
Sigh.
Fixes#2756.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5567043
Make the panic detectable, and use that in ioutil.ReadFile to
give an error if the file is too big.
R=golang-dev, minux.ma, bradfitz
CC=golang-dev
https://golang.org/cl/5563045
This fixes the bug Rob ran into when editing package bytes.
Regexp imports regexp/syntax, which imports bytes, and
regexp/syntax was not being properly recompiled during a
test of a change to package bytes.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5555065
Preserve test.
changeset: 11593:f1deaf35e1d1
user: Luuk van Dijk <lvd@golang.org>
date: Tue Jan 17 10:00:57 2012 +0100
summary: gc: fix infinite recursion for embedded interfaces
This is causing 'interface type loop' errors during compilation
of a complex program. I don't understand what's happening
well enough to boil it down to a simple test case, but undoing
this change fixes the problem.
The change being undone is fixing a corner case (uses of
pointer to interface in an interface definition) that basically
only comes up in erroneous Go programs. Let's not try to
fix this again until after Go 1.
Unfixes issue 1909.
TBR=lvd
CC=golang-dev
https://golang.org/cl/5555063
We already use GOHOSTOS to represent the host OS that the toolchain
will be run on, so no need to resort to uname(1) to get that (and
use uname(1) will make cross-compiling for another host impossible).
R=rsc, golang-dev
CC=golang-dev
https://golang.org/cl/5530050
- use proper Win64 gcc calling convention when
calling initcgo on amd64
- increase g0 stack size to 64K on amd64 to make
it the same as 386
- implement C.sleep
- do not use C.stat, since it is renamed to C._stat by mingw
- use fopen to implement TestErrno, since C.strtol
always succeeds on windows
- skip TestSetEnv on windows, because os.Setenv
sets windows process environment, while C.getenv
inspects internal C runtime variable instead
R=golang-dev, vcc.163, rsc
CC=golang-dev
https://golang.org/cl/5500094
instead of the origin.
This makes YCbCr match the other image types (e.g. RGBA, Gray) in
that an image's bounds is not restricted to the positive quadrant.
Also optimize the YCbCr draw code by hoisting some computation
outside of the loop.
benchmark old ns/op new ns/op delta
draw.BenchmarkYCbCr 2544418 2373558 -6.72%
Like https://golang.org/cl/4681044/ I don't think a gofix is
feasible. People will have to make manual changes. On the other hand,
directly manipulating YCbCr images is relatively rare, compared to
RGBA images, and if other code just uses the jpeg and draw packages
instead of messing directly with a YCbCr's []byte representations,
then things should just continue to work.
R=r
CC=golang-dev
https://golang.org/cl/5558048
Remove NewMD5, NewSHA1 and NewSHA256 in favor of using New and
explicitly importing the used hash-function. This way when using, for
example, HMAC with RIPEMD there's no md5, sha1 and sha256 linked in
through the hmac package.
A gofix rule is included, and applied to the standard library (3 files
altered).
This change is the result of a discussion at
https://golang.org/cl/5550043/ to pull the discussion about
deprecating these functions out of that issue.
R=golang-dev, agl
CC=golang-dev, r, rsc
https://golang.org/cl/5556058
Fix originally from rogpeppe in 5414048 but was rolled
back due to test breakage.
This CL makes the test more robust to order of operations.
Fixes#2480 again.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5536072
The previous version of all the node.String methods printed the parse
tree and was useful for developing the parse tree code. Now that that's done,
we might as well print the nodes using the standard template syntax.
It's much easier to read and makes error reporting look more natural.
Helps issue 2644.
R=rsc, n13m3y3r
CC=golang-dev
https://golang.org/cl/5553066
So as to give out stack trace for panic in examples.
This behavior also matches the tests'.
Fixes#2691.
R=golang-dev
CC=golang-dev
https://golang.org/cl/5554061
(Sending to r because of the API change.)
Over time we might want to add support for other key types.
While I was in the code, I also made the use of RawSubject the same
between Subject and Issuer when creating certificates.
R=r, rsc
CC=golang-dev
https://golang.org/cl/5554049
(Sending to r because of the API change.)
This change alters the API for crypto/elliptic to permit different
implementations in the future. This will allow us to add faster,
constant-time implementations of the standard curves without any more
API changes.
As a demonstration, it also adds a constant-time implementation of
P224. Since it's only 32-bit, it's actually only about 40% the speed
of the generic code on a 64-bit system.
R=r, rsc
CC=golang-dev
https://golang.org/cl/5528088
TestNonStandardNormalValues runs 1.5s,
the change reduces it to 0.2s in short mode.
The problem is with slow machines, emulators and dynamic tools.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5540065
Also, disable server-side generation of TOC for commands as they would
only ever show Overview. The JS does a better job (for now).
Fixes#2732.
R=gri, dsymonds
CC=golang-dev
https://golang.org/cl/5558046
It works with NewTicker too, but is potentially a bit less efficient,
and reads wrong.
This is what happens when you TBR Windows changes, I guess.
R=golang-dev, gri, iant
CC=golang-dev
https://golang.org/cl/5536060
This allows HTML pages to specify arbitrary data in a header:
<!--{
"Title": "The page title",
...
}-->
replacing the old style comments:
<!-- title The page title -->
R=gri, rsc, r, bradfitz, dsymonds
CC=golang-dev
https://golang.org/cl/5532093
Previously, a timeout (in int64 nanoseconds) applied to a granularity
even smaller than one operation: a 100 byte read with a 1 second timeout
could take 100 seconds, if the bytes all arrived on the network 1 second
apart. This was confusing.
Rather than making the timeout granularity be per-Read/Write,
this CL makes callers set an absolute deadline (in time.Time)
after which operations will fail. This makes it possible to
set deadlines at higher levels, without knowing exactly how
many read/write operations will happen in e.g. reading an HTTP
request.
Fixes#2723
R=r, rsc, dave
CC=golang-dev
https://golang.org/cl/5555048
This matches the other color models. It seems that this was missed
during the review of 5544073.
R=nigeltao, david.crawshaw
CC=golang-dev
https://golang.org/cl/5536057
Packages to test are kept in ./testdata together
with the corresponding golden (packagename.out)
file.
To update the golden files, run: go test -update
R=rsc
CC=golang-dev
https://golang.org/cl/5543054
- Use a faster closure-based iterator rather than a channel-based one.
- Otherwise: better code organization, but no other API changes.
R=r, r
CC=golang-dev
https://golang.org/cl/5557051