package main import ( "fmt" "net" "time" ) func main() { dialer := &net.Dialer{ Timeout: 5 * time.Second, KeepAlive: 30 * time.Second, } conn, err := dialer.Dial("tcp", "example.com:80") if err != nil { fmt.Println("Error: ", err) return } defer conn.Close() fmt.Println("Successfully connected to", conn.RemoteAddr()) // Do something with the connection here... }In this example, we create a new Dialer with a 5 second timeout and 30 second keep-alive interval. We dial a TCP connection to the server at example.com on port 80, and if successful, print a message indicating the connection was made successfully. Package library: "net" package in Go.