]> Cypherpunks repositories - gostls13.git/commitdiff
gotest: generate correct gofmt-formatted _testmain.go
authorRob Pike <r@golang.org>
Tue, 26 Oct 2010 00:03:25 +0000 (17:03 -0700)
committerRob Pike <r@golang.org>
Tue, 26 Oct 2010 00:03:25 +0000 (17:03 -0700)
Fixes #1225.

R=adg
CC=golang-dev
https://golang.org/cl/2729041

src/cmd/gotest/gotest

index e634a110892a53b942f90e42c0f62da03cb08e10..32b4aa538d941b40783694e8d33401f2b37e2afe 100755 (executable)
@@ -149,24 +149,24 @@ importpath=$(gomake -s importpath)
        echo 'import "testing"'
        # test array
        echo
-       echo 'var tests = []testing.Test {'
+       echo 'var tests = []testing.Test{'
        for i in $tests
        do
-               echo '  testing.Test{ "'$i'", '$i' },'
+               echo '  testing.Test{"'$i'", '$i'},'
        done
        echo '}'
        # benchmark array
-       echo 'var benchmarks = []testing.Benchmark {'
+       echo 'var benchmarks = []testing.Benchmark{'
        for i in $benchmarks
        do
-               echo '  testing.Benchmark{ "'$i'", '$i' },'
+               echo '  testing.Benchmark{"'$i'", '$i'},'
        done
        echo '}'
 
        # body
        echo
        echo 'func main() {'
-       echo '  testing.Main(tests);'
+       echo '  testing.Main(tests)'
        echo '  testing.RunBenchmarks(benchmarks)'
        echo '}'
 }>_testmain.go