From ca877731dcdc5c0ccf94410c89d1db4b68943081 Mon Sep 17 00:00:00 2001 From: Ainar Garipov Date: Fri, 21 Oct 2022 21:02:56 +0300 Subject: [PATCH] all: upd go --- .github/workflows/workflow.yaml | 4 ++-- bamboo-specs/bamboo.yaml | 2 +- netutil/addrconv.go | 5 ++--- netutil/ipmap.go | 2 ++ 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index e92d072..7884e17 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -13,9 +13,9 @@ - 'ubuntu-latest' 'steps': - 'uses': 'actions/checkout@master' - - 'uses': 'actions/setup-go@v2' + - 'uses': 'actions/setup-go@v3' 'with': - 'go-version': '1.17.x' + 'go-version': '1.18.x' - 'name': 'tests' 'run': 'make test' - 'name': 'coverage' diff --git a/bamboo-specs/bamboo.yaml b/bamboo-specs/bamboo.yaml index bb81278..4b6650c 100644 --- a/bamboo-specs/bamboo.yaml +++ b/bamboo-specs/bamboo.yaml @@ -5,7 +5,7 @@ 'key': 'GOLIBSSPECS' 'name': 'golibs' 'variables': - 'dockerGo': 'adguard/golang-ubuntu:4.3' + 'dockerGo': 'adguard/golang-ubuntu:5.2' 'stages': - diff --git a/netutil/addrconv.go b/netutil/addrconv.go index f57da0e..a5b1732 100644 --- a/netutil/addrconv.go +++ b/netutil/addrconv.go @@ -6,11 +6,10 @@ import ( "net/netip" ) -// IPv4Localhost returns 127.0.0.1, which returns true for [netip.Addr.Is4]. -// IPv4Unspecified returns the IPv4 unspecified address "0.0.0.0". +// IPv4Localhost returns the IPv4 localhost address "127.0.0.1". func IPv4Localhost() (ip netip.Addr) { return netip.AddrFrom4([4]byte{127, 0, 0, 1}) } -// IPv6Localhost returns ::1, which returns true for [netip.Addr.Is6]. +// IPv6Localhost returns the IPv6 localhost address "::1". func IPv6Localhost() (ip netip.Addr) { return netip.AddrFrom16([16]byte{15: 1}) } // ZeroPrefix returns an IP subnet with prefix 0 and all bytes of the IP address diff --git a/netutil/ipmap.go b/netutil/ipmap.go index b62e966..65ea470 100644 --- a/netutil/ipmap.go +++ b/netutil/ipmap.go @@ -25,6 +25,8 @@ func ipToArr(ip net.IP) (a ipArr) { } // IPMap is a map of IP addresses. +// +// Deprecated: Use map[netip.Addr]T instead. type IPMap struct { m map[ipArr]interface{} }