diff options
| author | Igor Dolzhikov <bluesriverz@gmail.com> | 2015-04-05 22:32:52 +0600 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2015-04-06 15:40:34 +0000 |
| commit | debe12cfcf9e0672bce0972cc22ff093f215ac59 (patch) | |
| tree | faa29530cbe5a8c180a89f966dbd0f8197af851f /src/math/big | |
| parent | c264c87335ff4b3111d43f830dbe37eac1509f2e (diff) | |
| download | go-debe12cfcf9e0672bce0972cc22ff093f215ac59.tar.xz | |
net/http, math/big, cmd/internal/gc/big: replaced errors.New(fmt.Sprintf(...)) in favour fmt.Errorf()
Change-Id: I38fc0ab84a374cb9be0234e40665d7cea0e76fc1
Reviewed-on: https://go-review.googlesource.com/8402
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/math/big')
| -rw-r--r-- | src/math/big/int.go | 3 | ||||
| -rw-r--r-- | src/math/big/rat.go | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/math/big/int.go b/src/math/big/int.go index 3410ec4729..7b419bf688 100644 --- a/src/math/big/int.go +++ b/src/math/big/int.go @@ -7,7 +7,6 @@ package big import ( - "errors" "fmt" "io" "math/rand" @@ -813,7 +812,7 @@ func (z *Int) GobDecode(buf []byte) error { } b := buf[0] if b>>1 != intGobVersion { - return errors.New(fmt.Sprintf("Int.GobDecode: encoding version %d not supported", b>>1)) + return fmt.Errorf("Int.GobDecode: encoding version %d not supported", b>>1) } z.neg = b&1 != 0 z.abs = z.abs.setBytes(buf[1:]) diff --git a/src/math/big/rat.go b/src/math/big/rat.go index 748796c8ca..fb16f18a96 100644 --- a/src/math/big/rat.go +++ b/src/math/big/rat.go @@ -546,7 +546,7 @@ func (z *Rat) GobDecode(buf []byte) error { } b := buf[0] if b>>1 != ratGobVersion { - return errors.New(fmt.Sprintf("Rat.GobDecode: encoding version %d not supported", b>>1)) + return fmt.Errorf("Rat.GobDecode: encoding version %d not supported", b>>1) } const j = 1 + 4 i := j + binary.BigEndian.Uint32(buf[j-4:j]) |
