Skip to content

math/big: Cannot use gob to encode big.Int #1496

@gopherbot

Description

@gopherbot

by reuben.bond:

What steps will reproduce the problem?
1. Attempt to Encode a big.Int using gob

What is the expected output?
Serialised big.Int

What do you see instead?
Nothing - this is 'expected' due to unexported fields, but not ideal from a programmers
perspective

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Ubuntu Linux 10.10 Maverick

Which revision are you using?  (hg identify)
7a3c74451e47 tip

Please provide any additional information below.
Why this is important: big.Int is used in cryptography structures.

A similar issue arises when using JSON, but JSON gives an out by supplying the
programmer with the option to provide their own marshal/unmarshal. A similar option for
Gob would be great.

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