ソースを参照

libnetwork: overlayutils: remove redundant init()

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 2 年 前
コミット
17feabcba0
1 ファイル変更2 行追加6 行削除
  1. 2 6
      libnetwork/drivers/overlay/overlayutils/utils.go

+ 2 - 6
libnetwork/drivers/overlay/overlayutils/utils.go

@@ -8,14 +8,10 @@ import (
 
 var (
 	mutex        sync.RWMutex
-	vxlanUDPPort uint32
+	vxlanUDPPort = defaultVXLANUDPPort
 )
 
-const defaultVXLANUDPPort = 4789
-
-func init() {
-	vxlanUDPPort = defaultVXLANUDPPort
-}
+const defaultVXLANUDPPort uint32 = 4789
 
 // ConfigVXLANUDPPort configures the VXLAN UDP port (data path port) number.
 // If no port is set, the default (4789) is returned. Valid port numbers are