mirror of
https://github.com/golang/go
synced 2024-11-19 23:44:43 -07:00
net: move init function into net.go
It's a single, package-wide init function specified for the net package. Change-Id: Id5894d65e1a92297cc16803cc5e4d4eef0b4b099 Reviewed-on: https://go-review.googlesource.com/8391 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
f244a1471d
commit
3a9024b498
@ -26,12 +26,6 @@ var (
|
|||||||
supportsIPv4map bool
|
supportsIPv4map bool
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
|
||||||
sysInit()
|
|
||||||
supportsIPv4 = probeIPv4Stack()
|
|
||||||
supportsIPv6, supportsIPv4map = probeIPv6Stack()
|
|
||||||
}
|
|
||||||
|
|
||||||
// A netaddr represents a network endpoint address or a list of
|
// A netaddr represents a network endpoint address or a list of
|
||||||
// network endpoint addresses.
|
// network endpoint addresses.
|
||||||
type netaddr interface {
|
type netaddr interface {
|
||||||
|
@ -46,6 +46,12 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
sysInit()
|
||||||
|
supportsIPv4 = probeIPv4Stack()
|
||||||
|
supportsIPv6, supportsIPv4map = probeIPv6Stack()
|
||||||
|
}
|
||||||
|
|
||||||
// Addr represents a network end point address.
|
// Addr represents a network end point address.
|
||||||
type Addr interface {
|
type Addr interface {
|
||||||
Network() string // name of the network
|
Network() string // name of the network
|
||||||
|
Loading…
Reference in New Issue
Block a user