]> Cypherpunks repositories - gostls13.git/commitdiff
net: move init function into net.go
authorMikio Hara <mikioh.mikioh@gmail.com>
Wed, 1 Apr 2015 13:46:12 +0000 (22:46 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Fri, 3 Apr 2015 00:23:23 +0000 (00:23 +0000)
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>
src/net/ipsock.go
src/net/net.go

index 98d2dbffb7efc1544a6d26fa8eecc719761aab77..c54b94da40523de02ecc3406c1ebb53831a5dfef 100644 (file)
@@ -26,12 +26,6 @@ var (
        supportsIPv4map bool
 )
 
-func init() {
-       sysInit()
-       supportsIPv4 = probeIPv4Stack()
-       supportsIPv6, supportsIPv4map = probeIPv6Stack()
-}
-
 // A netaddr represents a network endpoint address or a list of
 // network endpoint addresses.
 type netaddr interface {
index 339c972906a6aa6e9b2faad1154db9be6f0642ff..3b06e6b4898d068b8e7ea863a0f989f839b2042d 100644 (file)
@@ -46,6 +46,12 @@ import (
        "time"
 )
 
+func init() {
+       sysInit()
+       supportsIPv4 = probeIPv4Stack()
+       supportsIPv6, supportsIPv4map = probeIPv6Stack()
+}
+
 // Addr represents a network end point address.
 type Addr interface {
        Network() string // name of the network