Table of Contents

net.Dial (TCP client connection)

What is it?

`net.Dial(network, address)` initiates an outgoing connection to `address` using the named `network`.

Common networks:

What is it used for?

Example (TCP)

package main
 
import (
    "net"
)
 
func main() {
    conn, err := net.Dial("tcp", "example.com:80")
    if err != nil {
        return
    }
    defer conn.Close()
}

Notes

Hard words (English)