I have map with key as net.IP and value as a channel. But I'm getting a weird compile time error (invalid map key type)
17 type UdpServer struct {
18 ListenPort int
19
20 ConnRef *net.UDPConn
21 Log_ref *Logger
22 MapOfValues map[net.IP]chan string
23 }
$ go build c-manager.go
cmanager/c-udp_server.go:22:14: invalid map key type net.IP
$ go version
go version go1.10.2 linux/amd64
What am I doing wrong? Can't we have net.IP as map key type?