]> Cypherpunks repositories - gostls13.git/commitdiff
pkg: minor cleanup
authorRuss Cox <rsc@golang.org>
Mon, 31 Oct 2011 21:53:39 +0000 (17:53 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 31 Oct 2011 21:53:39 +0000 (17:53 -0400)
remove some redundant .String()
change variable name to make it os.Error-proof

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5302075

src/pkg/archive/zip/struct.go
src/pkg/big/int_test.go
src/pkg/big/rat_test.go

index a32de5a9e0d49fa783a599488e435890170eb614..4f9f599a1484d507f696f79158d2f5129d963a85 100644 (file)
@@ -60,10 +60,10 @@ type directoryEnd struct {
        comment            string
 }
 
-func recoverError(err *os.Error) {
+func recoverError(errp *os.Error) {
        if e := recover(); e != nil {
-               if osErr, ok := e.(os.Error); ok {
-                       *err = osErr
+               if err, ok := e.(os.Error); ok {
+                       *errp = err
                        return
                }
                panic(e)
index fde19c23b720ef08915401fdda59fb0587e6e3a6..d66bb5fa0530c877139a50f744213b79c3d3855f 100644 (file)
@@ -536,7 +536,7 @@ func TestScan(t *testing.T) {
                buf.Reset()
                buf.WriteString(test.input)
                if _, err := fmt.Fscanf(&buf, test.format, x); err != nil {
-                       t.Errorf("#%d error: %s", i, err.String())
+                       t.Errorf("#%d error: %s", i, err)
                }
                if x.String() != test.output {
                        t.Errorf("#%d got %s; want %s", i, x.String(), test.output)
index a95e5fea3a52097628e52358b3c52001615968ad..2443450411323d49e0672d99c92a16b341675b77 100644 (file)
@@ -112,7 +112,7 @@ func TestRatScan(t *testing.T) {
                _, err := fmt.Fscanf(&buf, "%v", x)
                if err == nil != test.ok {
                        if test.ok {
-                               t.Errorf("#%d error: %s", i, err.String())
+                               t.Errorf("#%d error: %s", i, err)
                        } else {
                                t.Errorf("#%d expected error", i)
                        }