diff --git a/.golangci.yml b/.golangci.yml index a7c69123..aff1ba10 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -12,13 +12,10 @@ linters-settings: linters: disable-all: true enable: # see https://golangci-lint.run/usage/linters/ - - deadcode + - unused - staticcheck - govet - gofmt - goimports - gosec - misspell - -run: - deadline: 5m diff --git a/Makefile b/Makefile index 8a3b04dd..e3a002fa 100755 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ test: docker-test-integration # code linting .golangci-bin: @echo "===> Installing Golangci-lint <===" - @curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $@ v1.41.1 + @curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $@ v1.50.1 .PHONY: golangci golangci: .golangci-bin diff --git a/VERSION b/VERSION index 41a02aff..ca46cd28 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v0.6.7 +v0.6.8 diff --git a/ofctrl/dial.go b/ofctrl/dial.go index 479025b8..7f983788 100644 --- a/ofctrl/dial.go +++ b/ofctrl/dial.go @@ -1,3 +1,4 @@ +//go:build linux || darwin // +build linux darwin package ofctrl diff --git a/ofctrl/fgraph.go b/ofctrl/fgraph.go index c2aff398..08d95cd0 100644 --- a/ofctrl/fgraph.go +++ b/ofctrl/fgraph.go @@ -1,4 +1,4 @@ -/*** +/* Copyright 2014 Cisco Systems Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ofctrl/fgraphFlood.go b/ofctrl/fgraphFlood.go index 4249a76e..8a7409a0 100644 --- a/ofctrl/fgraphFlood.go +++ b/ofctrl/fgraphFlood.go @@ -1,4 +1,4 @@ -/*** +/* Copyright 2014 Cisco Systems Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ofctrl/fgraphFlow.go b/ofctrl/fgraphFlow.go index eaf86a5f..347871a7 100644 --- a/ofctrl/fgraphFlow.go +++ b/ofctrl/fgraphFlow.go @@ -1,4 +1,4 @@ -/*** +/* Copyright 2014 Cisco Systems Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); @@ -1906,10 +1906,10 @@ func (self *Flow) ConnTrack(commit bool, force bool, tableID *uint8, zoneID *uin // Special Actions to to the flow to set conjunctions // Note: -// 1) nclause should be in [2, 64]. -// 2) clause value should be less than or equals to ncluase, and its value should be started from 1. -// actual clause in libopenflow messages is started from 0, here would decrement 1 to keep the display -// value is consistent with expected configuration +// 1. nclause should be in [2, 64]. +// 2. clause value should be less than or equals to ncluase, and its value should be started from 1. +// actual clause in libopenflow messages is started from 0, here would decrement 1 to keep the display +// value is consistent with expected configuration func (self *Flow) AddConjunction(conjID uint32, clause uint8, nClause uint8) error { conjunction, err := NewNXConjunctionAction(conjID, clause, nClause) if err != nil { diff --git a/ofctrl/fgraphOutput.go b/ofctrl/fgraphOutput.go index be8d67c5..c212804c 100644 --- a/ofctrl/fgraphOutput.go +++ b/ofctrl/fgraphOutput.go @@ -1,4 +1,4 @@ -/*** +/* Copyright 2014 Cisco Systems Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ofctrl/fgraphSwitch.go b/ofctrl/fgraphSwitch.go index 5626db4f..38afc30d 100644 --- a/ofctrl/fgraphSwitch.go +++ b/ofctrl/fgraphSwitch.go @@ -1,4 +1,4 @@ -/*** +/* Copyright 2014 Cisco Systems Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ofctrl/fgraphTable.go b/ofctrl/fgraphTable.go index 3fef4072..68ec63be 100755 --- a/ofctrl/fgraphTable.go +++ b/ofctrl/fgraphTable.go @@ -1,4 +1,4 @@ -/*** +/* Copyright 2014 Cisco Systems Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ofctrl/ofSwitch.go b/ofctrl/ofSwitch.go index 51394020..cf719c23 100755 --- a/ofctrl/ofSwitch.go +++ b/ofctrl/ofSwitch.go @@ -1,4 +1,4 @@ -/*** +/* Copyright 2014 Cisco Systems Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ofctrl/ofctrl_test.go b/ofctrl/ofctrl_test.go index a5b9fa89..f929fed9 100644 --- a/ofctrl/ofctrl_test.go +++ b/ofctrl/ofctrl_test.go @@ -1,4 +1,4 @@ -/*** +/* Copyright 2014 Cisco Systems Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/ofctrl/ofpacket_test.go b/ofctrl/ofpacket_test.go index 19e21e37..a01b0898 100644 --- a/ofctrl/ofpacket_test.go +++ b/ofctrl/ofpacket_test.go @@ -277,7 +277,8 @@ func generateTCPPacketOut(srcMAC, dstMAC net.HardwareAddr, srcIP net.IP, dstIP n } // keeping this in case it is useful later -//nolint:deadcode +// +//nolint:unused func generatePacketOut(srcMAC net.HardwareAddr, dstMAC net.HardwareAddr, srcIP net.IP, dstIP net.IP, outputPort *uint32, actions []OFAction) *PacketOut { var outPort uint32 if outputPort == nil { diff --git a/ofctrl/ovsdbDriver.go b/ofctrl/ovsdbDriver.go index 592200a5..0e82224c 100644 --- a/ofctrl/ovsdbDriver.go +++ b/ofctrl/ovsdbDriver.go @@ -479,7 +479,7 @@ func (self *OvsDriver) RemoveController(target string) error { // Check the local cache and see if the portname is taken already // HACK alert: This is used to pick next port number instead of managing -// port number space actively across agent restarts +// port number space actively across agent restarts func (self *OvsDriver) IsPortNamePresent(intfName string) bool { // lock the cache for read self.lock.RLock()