Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: implement MarshalText/UnmarshalText for IP type #5086

Closed
gopherbot opened this issue Mar 20, 2013 · 6 comments
Closed

net: implement MarshalText/UnmarshalText for IP type #5086

gopherbot opened this issue Mar 20, 2013 · 6 comments
Milestone

Comments

@gopherbot
Copy link

by giacomo.tartari:

What steps will reproduce the problem?
http://play.golang.org/p/o-7AnROIPq

What is the expected output?
The unmarshaled IP 

What do you see instead?
Error json: cannot unmarshal string into Go value of type net.IP

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

Which operating system are you using?
Drarwin 11.4.2

Which version are you using?  (run 'go version')
go version devel +7bcfc5879223 Thu Mar 14 13:48:19 2013 +0400 darwin/amd64

Please provide any additional information below.
A small discussion and a fix proposal here:
https://groups.google.com/d/msg/golang-nuts/io8aHJarm6U/VFYIWdDvLsYJ.
@gopherbot
Copy link
Author

Comment 1 by giacomo.tartari:

Sorry for the messy description it should have been something like: 
net.IP: would like to implement json.Marshaler/json.Unmarshaler.

@rsc
Copy link
Contributor

rsc commented Jul 12, 2013

Comment 3:

This issue was closed by revision 5930649.

Status changed to Fixed.

@rsc
Copy link
Contributor

rsc commented Jul 12, 2013

Comment 4:

This issue was closed by revision 4419d7e.

@mikioh
Copy link
Contributor

mikioh commented Jul 20, 2013

Comment 5:

Go 1.2: encoding.TextMarshaler and TextUnmarshaler
https://groups.google.com/d/msg/golang-dev/pXLNF6lH9WE/qVMpNweYSgAJ
Hm, we probably could assume that TextMarshaler will return a consistent address
representation regardless of its internal address format; e.g., IPv6 IPv4-mapped
net.IP(`::ffff:127.0.0.1`) or IPv4 net.IP(`127.0.0.1`).

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 6:

Labels changed: added priority-later, go1.2, feature, removed priority-triage.

@robpike
Copy link
Contributor

robpike commented Aug 16, 2013

Comment 7:

I believe this is fixed at tip. The program above now prints
IP 127.0.0.1 
JSON "127.0.0.1"
IP again 127.0.0.1
Marking as Fixed.

Status changed to Fixed.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants