mirror of
https://github.com/golang/go
synced 2024-11-25 13:57:57 -07:00
The Go programming language
ccc4553491
Before: $ go test -c -cover fmt $ ./fmt.test -test.covermode=set PASS coverage: 65.1% of statements in strconv $ After: $ go test -c -cover fmt $ ./fmt.test PASS coverage: 65.1% of statements in strconv $ In addition to being cumbersome, the old flag didn't make sense: the cover mode cannot be changed after the binary has been built. Another useful effect of this CL is that if you happen to do $ go test -c -covermode=atomic fmt and then forget you did that and run benchmarks, the final line of the output (the coverage summary) reminds you that you are benchmarking with coverage enabled, which might not be what you want. $ ./fmt.test -test.bench . PASS BenchmarkSprintfEmpty 10000000 217 ns/op BenchmarkSprintfString 2000000 755 ns/op BenchmarkSprintfInt 2000000 774 ns/op BenchmarkSprintfIntInt 1000000 1363 ns/op BenchmarkSprintfPrefixedInt 1000000 1501 ns/op BenchmarkSprintfFloat 1000000 1257 ns/op BenchmarkManyArgs 500000 5346 ns/op BenchmarkScanInts 1000 2562402 ns/op BenchmarkScanRecursiveInt 500 3189457 ns/op coverage: 91.4% of statements $ As part of passing the new mode setting in via _testmain.go, merge the two registration mechanisms into one extensible mechanism (a struct). R=r CC=golang-dev https://golang.org/cl/11219043 |
||
---|---|---|
api | ||
doc | ||
include | ||
lib | ||
misc | ||
src | ||
test | ||
.hgignore | ||
.hgtags | ||
AUTHORS | ||
CONTRIBUTORS | ||
favicon.ico | ||
LICENSE | ||
PATENTS | ||
README | ||
robots.txt |
This is the source code repository for the Go programming language. For documentation about how to install and use Go, visit http://golang.org/ or load doc/install.html in your web browser. After installing Go, you can view a nicely formatted doc/install.html by running godoc --http=:6060 and then visiting http://localhost:6060/doc/install.html. Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file. -- Binary Distribution Notes If you have just untarred a binary Go distribution, you need to set the environment variable $GOROOT to the full path of the go directory (the one containing this README). You can omit the variable if you unpack it into /usr/local/go, or if you rebuild from sources by running all.bash (see doc/install.html). You should also add the Go binary directory $GOROOT/bin to your shell's path. For example, if you extracted the tar file into $HOME/go, you might put the following in your .profile: export GOROOT=$HOME/go export PATH=$PATH:$GOROOT/bin See doc/install.html for more details.