-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Open
Milestone
Description
What version of Go are you using (go version)?
$ go version go1.10 linux/amd64
Does this issue reproduce with the latest release?
Yes.
What did you do?
I'm trying to unmarshal json content into net.IP and net.HardwareAddr.
Both types are actually of type []byte
Since net.IP implements json.Marshaler, it works as expected. However, net.HardwareAddr does not and fails with the error "illegal base64 data at input byte 2" (that's the position of the separator).
Here's an example:
https://play.golang.org/p/HOBBAyvpfrK
I found the google group discussion about adding the Marshaller to the net.IP type: https://groups.google.com/forum/#!topic/golang-nuts/io8aHJarm6U
What did you expect to see?
I expect net.HardwareAddr to be consistent with net.IP and implement json.Marshaler.
Strings in the form of "ab:cd:ef:ab:cd:ef" inside json should be parsable to MAC addresses.
OneOfOne, kihamo, Marcon, genofire, florianl and 16 more
Metadata
Metadata
Assignees
Type
Projects
Status
Accepted