From 83670b2e3109249e63d22cf625daebdc491f3622 Mon Sep 17 00:00:00 2001 From: Arseny Balobanov Date: Tue, 10 May 2022 13:14:30 +0300 Subject: [PATCH] Update golangci-lint to 1.46.0: add some nolints to iprange. --- build.docker | 2 +- iprange/funcs.go | 1 + iprange/sortip.go | 1 + iprange/y.go | 2 ++ 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build.docker b/build.docker index 86a104c..69cd6a4 100644 --- a/build.docker +++ b/build.docker @@ -4,7 +4,7 @@ RUN apt-get update && apt-get install -y \ rsync libssl-dev postgresql sudo redis-server \ && rm -rf /var/lib/apt/lists/* -RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.45.2 +RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.46.0 RUN curl -L "https://github.com/docker/compose/releases/download/1.28.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose RUN chmod +x /usr/local/bin/docker-compose RUN curl -fsSL https://get.docker.com | sh diff --git a/iprange/funcs.go b/iprange/funcs.go index ed99418..7ff94c1 100644 --- a/iprange/funcs.go +++ b/iprange/funcs.go @@ -25,6 +25,7 @@ func streamRange(lower, upper net.IP) chan net.IP { upper32 := binary.BigEndian.Uint32([]byte(upper)) diff := upper32 - lower32 + // nolint if diff < 0 { panic("Lower address is actually higher than upper address.") } diff --git a/iprange/sortip.go b/iprange/sortip.go index 234f662..44e41ee 100644 --- a/iprange/sortip.go +++ b/iprange/sortip.go @@ -22,6 +22,7 @@ func (a asc) Less(i, j int) bool { bigi := big.NewInt(0).SetBytes(a[i]) bigj := big.NewInt(0).SetBytes(a[j]) + // nolint if bigi.Cmp(bigj) == -1 { return true } diff --git a/iprange/y.go b/iprange/y.go index f469c02..734805f 100644 --- a/iprange/y.go +++ b/iprange/y.go @@ -44,6 +44,7 @@ var ipToknames = [...]string{ } var ipStatenames = [...]string{} +// nolint const ipEofCode = 1 const ipErrCode = 2 const ipInitialStackSize = 16 @@ -166,6 +167,7 @@ type ipParserImpl struct { char int } +// nolint func (p *ipParserImpl) Lookahead() int { return p.char }