Commit c01c1d42 authored by Russ Cox's avatar Russ Cox

net: add examples to Addr definition

Fixes #16014.

Change-Id: I68b096df7924a3258e940c4d94ec5d06f5bdfcbb
Reviewed-on: https://go-review.googlesource.com/32097Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent eac59508
...@@ -102,9 +102,13 @@ func init() { ...@@ -102,9 +102,13 @@ func init() {
} }
// Addr represents a network end point address. // Addr represents a network end point address.
//
// The two methods Network and String conventionally return strings
// that can be passed as the arguments to Dial, but the exact form
// and meaning of the strings is up to the implementation.
type Addr interface { type Addr interface {
Network() string // name of the network Network() string // name of the network (for example, "tcp", "udp")
String() string // string form of address String() string // string form of address (for example, "127.0.0.1:25", "[2001:db8::1]:80")
} }
// Conn is a generic stream-oriented network connection. // Conn is a generic stream-oriented network connection.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment