diff options
author | Robert Griesemer <gri@golang.org> | 2015-09-25 16:35:54 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2015-09-29 00:21:45 +0000 |
commit | 38c5fd5cf872cf2eabad1361342097e11d292c91 (patch) | |
tree | dda8a302101fca4eafc1119bcddc782b5434749c /src/math/big/ratmarsh.go | |
parent | 02e8ec008ca80e6b7dd93410aa9abac3a906dee4 (diff) | |
download | go-38c5fd5cf872cf2eabad1361342097e11d292c91.tar.gz go-38c5fd5cf872cf2eabad1361342097e11d292c91.zip |
math/big: implement Float.Text(Un)Marshaler
Fixes #12256.
Change-Id: Ie4a3337996da5c060b27530b076048ffead85f3b
Reviewed-on: https://go-review.googlesource.com/15040
Reviewed-by: Alan Donovan <adonovan@google.com>
Diffstat (limited to 'src/math/big/ratmarsh.go')
-rw-r--r-- | src/math/big/ratmarsh.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/math/big/ratmarsh.go b/src/math/big/ratmarsh.go index 6bb9d8af60..b82e8d4ae8 100644 --- a/src/math/big/ratmarsh.go +++ b/src/math/big/ratmarsh.go @@ -58,15 +58,15 @@ func (z *Rat) GobDecode(buf []byte) error { } // MarshalText implements the encoding.TextMarshaler interface. -func (r *Rat) MarshalText() (text []byte, err error) { +func (x *Rat) MarshalText() (text []byte, err error) { // TODO(gri): get rid of the []byte/string conversion - return []byte(r.RatString()), nil + return []byte(x.RatString()), nil } // UnmarshalText implements the encoding.TextUnmarshaler interface. -func (r *Rat) UnmarshalText(text []byte) error { +func (z *Rat) UnmarshalText(text []byte) error { // TODO(gri): get rid of the []byte/string conversion - if _, ok := r.SetString(string(text)); !ok { + if _, ok := z.SetString(string(text)); !ok { return fmt.Errorf("math/big: cannot unmarshal %q into a *big.Rat", text) } return nil |