How to convert net.IP to string

2,640 views
Skip to first unread message

Amee Trivedi

unread,
Dec 7, 2014, 2:30:23 PM12/7/14
to golan...@googlegroups.com
Hi,

I need to convert net.IP to string.

Golang doc says:
can be used but i am unable to use it.

I am trying to convert it by using all possible ways:

  IP.String(msg.SelfIP)
  net.String(msg.SelfIP)
  String(msg.SelfIP)

But, It keeps giving me error.

Can someone please direct me on how to convert net.IP to string???




Kostarev Ilya

unread,
Dec 7, 2014, 2:44:12 PM12/7/14
to Amee Trivedi, golan...@googlegroups.com
Try msg.SelfIP.String()

-- 
Kostarev Ilya

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Amee Trivedi

unread,
Dec 7, 2014, 5:09:21 PM12/7/14
to golan...@googlegroups.com, ameet...@gmail.com
Thank you that worked.
Reply all
Reply to author
Forward
0 new messages