Reader previously had cached an error from the underlying reader
and would return it on every subsequent call to Read. The Reader
will now return the error only once, and subsequent calls will result
in a new Read call to the underlying Reader.
Fixes#1934.
R=bradfitz, rogpeppe, rsc
CC=golang-dev
https://golang.org/cl/4528133
-test.benchtime allows to specify benchmark execution time.
-test.cpu allows to execute tests/benchmarks for several
values of GOMAXPROCS.
R=r, r, rsc
CC=golang-dev
https://golang.org/cl/4662046
Plus fix spoiling of GOMAXPROCS in 2 existing rwmutex tests.
Plus fix benchmark output to stdout (now it outputs to stderr like all other output).
R=rsc
CC=golang-dev
https://golang.org/cl/4529111
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
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
New make target "testshort" runs "gotest -test.short" and is invoked
by run.bash, which is invoked by all.bash.
Use -test.short to make one package (crypto ecdsa) run much faster.
More changes to come.
Once this is in, I will update the long-running tests to use the new flag.
R=rsc
CC=golang-dev
https://golang.org/cl/4317043
Flags defined in the testing package may conflict
with real flags defined in the main package, or in
any other imported package.
This change makes them less likely to be used for
other purposes.
R=r, rsc, r2
CC=golang-dev
https://golang.org/cl/4167055
Rather than updating the stripped-down regexp implementation embedded
in testing, delete it by passing the one function we need from the package
main file created by gotest.
R=rsc
CC=golang-dev
https://golang.org/cl/2761043
New logging interface simplifies and generalizes.
1) Loggers now have only one output.
2) log.Stdout, Stderr, Crash and friends are gone.
Logging is now always to standard error by default.
3) log.Panic* replaces log.Crash*.
4) Exiting and panicking are not part of the logger's state; instead
the functions Exit* and Panic* simply call Exit or panic after
printing.
5) There is now one 'standard logger'. Instead of calling Stderr,
use Print etc. There are now triples, by analogy with fmt:
Print, Println, Printf
What was log.Stderr is now best represented by log.Println,
since there are now separate Print and Println functions
(and methods).
6) New functions SetOutput, SetFlags, and SetPrefix allow global
editing of the standard logger's properties. This is new
functionality. For instance, one can call
log.SetFlags(log.Lshortfile|log.Ltime|log.Lmicroseconds)
to get all logging output to show file name, line number, and
time stamp.
In short, for most purposes
log.Stderr -> log.Println or log.Print
log.Stderrf -> log.Printf
log.Crash -> log.Panicln or log.Panic
log.Crashf -> log.Panicf
log.Exit -> log.Exitln or log.Exit
log.Exitf -> log.Exitf (no change)
This has a slight breakage: since loggers now write only to one
output, existing calls to log.New() need to delete the second argument.
Also, custom loggers with exit or panic properties will need to be
reworked.
All package code updated to new interface.
The test has been reworked somewhat.
The old interface will be removed after the new release.
For now, its elements are marked 'deprecated' in their comments.
Fixes#1184.
R=rsc
CC=golang-dev
https://golang.org/cl/2419042
parsing and printing to new syntax.
Use -oldparser to parse the old syntax,
use -oldprinter to print the old syntax.
2) Change default gofmt formatting settings
to use tabs for indentation only and to use
spaces for alignment. This will make the code
alignment insensitive to an editor's tabwidth.
Use -spaces=false to use tabs for alignment.
3) Manually changed src/exp/parser/parser_test.go
so that it doesn't try to parse the parser's
source files using the old syntax (they have
new syntax now).
4) gofmt -w src misc test/bench
5th and last set of files.
R=rsc
CC=golang-dev
https://golang.org/cl/180050
- no need to replace comments for stand-alone blocks
- always print string concatenations with interspersed "+"
(remove option)
- minor cleanups
R=rsc
https://golang.org/cl/174076
the bash scripts and makefiles for building go didn't take into account
the fact $GOROOT / $GOBIN could both be directories containing whitespaces,
and was not possible to build it in such a situation.
this commit adjusts the various makefiles/scripts to make it aware of that
possibility, and now it builds successfully when using a path with whitespaces
as well.
Fixes#115.
R=rsc, dsymonds1
https://golang.org/cl/157067