Update comment for SplitHostPort
This commit is contained in:
parent
497e99d58b
commit
ad69440af1
@ -32,8 +32,7 @@ func main() {
|
|||||||
fmt.Println(p)
|
fmt.Println(p)
|
||||||
|
|
||||||
// The `Host` contains both the hostname and the port,
|
// The `Host` contains both the hostname and the port,
|
||||||
// if present. `Split` the `Host` manually to extract
|
// if present. Use `SplitHostPort` to extract them.
|
||||||
// the port.
|
|
||||||
fmt.Println(u.Host)
|
fmt.Println(u.Host)
|
||||||
host, port, _ := net.SplitHostPort(u.Host)
|
host, port, _ := net.SplitHostPort(u.Host)
|
||||||
fmt.Println(host)
|
fmt.Println(host)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user