update go version to 1.18

This commit is contained in:
octeep 2022-05-20 12:21:41 +01:00 committed by octeep
parent cafcdcd566
commit e686381fa9
9 changed files with 41 additions and 66 deletions

View file

@ -9,7 +9,7 @@ import (
"github.com/go-ini/ini"
"golang.zx2c4.com/go118/netip"
"net/netip"
)
// DeviceConfig contains the information to initiate a wireguard connection
@ -109,7 +109,7 @@ func parseNetIP(section *ini.Section, keyName string) ([]netip.Addr, error) {
return []netip.Addr{}, nil
}
ips := []netip.Addr{}
var ips []netip.Addr
for _, str := range key.StringsWithShadows(",") {
str = strings.TrimSpace(str)
ip, err := netip.ParseAddr(str)
@ -127,7 +127,7 @@ func parseCIDRNetIP(section *ini.Section, keyName string) ([]netip.Addr, error)
return []netip.Addr{}, nil
}
ips := []netip.Addr{}
var ips []netip.Addr
for _, str := range key.StringsWithShadows(",") {
prefix, err := netip.ParsePrefix(str)
if err != nil {
@ -353,7 +353,7 @@ func ParseConfig(path string) (*Configuration, error) {
return nil, err
}
routinesSpawners := []RoutineSpawner{}
var routinesSpawners []RoutineSpawner
err = parseRoutinesConfig(&routinesSpawners, cfg, "TCPClientTunnel", parseTCPClientTunnelConfig)
if err != nil {