Posted on 28th March 2023
Look at this example
Source sample.go
package main
import (
"net"
"fmt"
)
func main() {
add,err := net.LookupIP("ispycode.com")
if err != nil {
fmt.Println("host is unknown")
} else {
fmt.Println("This is the IP address: ", add)
}
}
Output:
$go run sample.go
This is the IP address: [80. 75. 225. 3]
STILL GOT QUERIES?
Copyright © 2013 - 2023 MindMajix Technologies