Skip to content

math/big: big.Rat has not Marshall/Unmarshall methods #7287

@gopherbot

Description

@gopherbot

by skurtsev:

It seems that no Marshal/Unmarshal methods available for big.Rat whilst big.Int has
proper methods. E.g. marshaling big.Rat inside struct results in empty value for big.Rat
fields: see INVALID_RAT in json output at http://play.golang.org/p/M_IgJUGSpo

What steps will reproduce the problem?
1. Create big.Rat var inside another struct
2. Call json.Marshall for the struct
3.

What is the expected output?
big.Rat must be serialized to json (unserialized from json)

What do you see instead?
Empty {} instead of big.Rat's serialized value

Which operating system are you using?
Linux localhost 3.12.9-301.fc20.i686+PAE #1 SMP Wed Jan 29 16:12:24 UTC 2014 i686 i686
i386 GNU/Linux


Which version are you using?  (run 'go version')
go version go1.2 linux/386

Please provide any additional information below.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions