package main import ( "fmt" "net" ) func server() { } func getIP(conn net.Conn) (address *net.TCPAddr) { if addr, ok := conn.RemoteAddr().(*net.TCPAddr); ok { return addr //fmt.Printf("Received connection from: %v\n", addr) } return } func handleConn(conn net.Conn) { fmt.Println() address := getIP(conn) fmt.Printf("%v connected!\n", address) }