ip0:=byte(sliceIPDestination[0])
And the error message :
./main.go:325: cannot convert sliceIPDestination[0] (type string) to type byte
IPDestination := "10.11.204.205"
IPAddress:=net.ParseIP(IPDestination)
fmt.Printf("%s\n",IPAddress[3])
fmt.Printf("%s\n",IPAddress)
The output is :
%!s(uint8=0)
10.11.204.205
I am not sure the output has been sliced.
func main() {
IPDestination := "10.11.204.205"
conn, err := net.ListenUDP("udp", &net.UDPAddr{IP: net.IPv4zero, Port: 0})
IPAddress:=net.ParseIP(IPDestination)
_, err = conn.WriteToUDP([]byte("wake"), &net.UDPAddr{IP: net.IP{IPAddress[0], IPAddress[1], IPAddress[2], IPAddress[3]}, Port: 7})
if err!=nil{
}
fmt.Printf("%v",IPAddress[0])
fmt.Printf("%v",IPAddress[1])
fmt.Printf("%v",IPAddress[2])
fmt.Printf("%v",IPAddress[3])
}