diff --git a/.golangci.yml b/.golangci.yml index 23566f7..9083b5e 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -19,3 +19,6 @@ linters: - wrapcheck # don't enforce error wrapping - exhaustivestruct # don't require exhaustive structs - durationcheck # has false positives + - scopelint # deprecated + - golint # deprecated + - maligned # deprecated diff --git a/go.mod b/go.mod index 99ffbfc..2c0a169 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,14 @@ module go.einride.tech/vlp16 -go 1.14 +go 1.17 require ( golang.org/x/net v0.0.0-20201224014010-6772e930b67b gotest.tools/v3 v3.0.3 ) + +require ( + github.com/google/go-cmp v0.4.0 // indirect + github.com/pkg/errors v0.8.1 // indirect + golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 // indirect +) diff --git a/packetlistener.go b/packetlistener.go index 0848d7a..9907d6d 100644 --- a/packetlistener.go +++ b/packetlistener.go @@ -25,7 +25,10 @@ func ListenUDP(ctx context.Context, addr string, listenOpts ...ListenOption) (_ if err != nil { return nil, err } - udpConn := packetConn.(*net.UDPConn) + udpConn, ok := packetConn.(*net.UDPConn) + if !ok { + return nil, fmt.Errorf("listenudp couldn't convert type to udpconn") + } if err := udpConn.SetReadBuffer(opts.bufferSizeBytes); err != nil { return nil, err } diff --git a/sensor.go b/sensor.go index e43fd13..871e371 100644 --- a/sensor.go +++ b/sensor.go @@ -5,7 +5,7 @@ import ( ) const ( - // CloumnsPerPacket is the number of columns in point cloud matrix. + // ColumnsPerPacket is the number of columns in point cloud matrix. ColumnsPerPacket = BlocksPerPacket * 2 // RowsPerColumnSingleReturn is the number of rows in point cloud in single return mode. RowsPerColumnSingleReturn = 16 diff --git a/tools/golangci-lint/rules.mk b/tools/golangci-lint/rules.mk index dd539a3..33c76a4 100644 --- a/tools/golangci-lint/rules.mk +++ b/tools/golangci-lint/rules.mk @@ -1,5 +1,5 @@ golangci_lint_cwd := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) -golangci_lint_version := 1.37.0 +golangci_lint_version := 1.42.1 golangci_lint := $(golangci_lint_cwd)/$(golangci_lint_version)/golangci-lint ifeq ($(shell uname),Linux) diff --git a/tools/goreview/rules.mk b/tools/goreview/rules.mk index efec32c..4cd6909 100644 --- a/tools/goreview/rules.mk +++ b/tools/goreview/rules.mk @@ -1,5 +1,5 @@ goreview_cwd := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) -goreview_version := 0.16.0 +goreview_version := 0.18.0 goreview := $(goreview_cwd)/$(goreview_version)/goreview goreview_archive_url := https://github.com/einride/goreview/releases/download/v$(goreview_version)/goreview_$(goreview_version)_$(shell uname)_$(shell uname -m).tar.gz diff --git a/tools/stringer/go.mod b/tools/stringer/go.mod index e581c2c..1285de2 100644 --- a/tools/stringer/go.mod +++ b/tools/stringer/go.mod @@ -1,5 +1,10 @@ module tools/stringer -go 1.13 +go 1.17 require golang.org/x/tools v0.0.0-20201208062317-e652b2f42cc7 + +require ( + golang.org/x/mod v0.3.0 // indirect + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect +)