Skip to content

Commit

Permalink
Fix Github action golangci-lint issue. (#48)
Browse files Browse the repository at this point in the history
Signed-off-by: Hongliang Liu <[email protected]>
  • Loading branch information
hongliangl authored Mar 10, 2023
1 parent 21f844c commit 6becde3
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 20 deletions.
5 changes: 1 addition & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.6.7
v0.6.8
1 change: 1 addition & 0 deletions ofctrl/dial.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux || darwin
// +build linux darwin

package ofctrl
Expand Down
2 changes: 1 addition & 1 deletion ofctrl/fgraph.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/***
/*
Copyright 2014 Cisco Systems Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion ofctrl/fgraphFlood.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/***
/*
Copyright 2014 Cisco Systems Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
10 changes: 5 additions & 5 deletions ofctrl/fgraphFlow.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/***
/*
Copyright 2014 Cisco Systems Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion ofctrl/fgraphOutput.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/***
/*
Copyright 2014 Cisco Systems Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion ofctrl/fgraphSwitch.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/***
/*
Copyright 2014 Cisco Systems Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion ofctrl/fgraphTable.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/***
/*
Copyright 2014 Cisco Systems Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion ofctrl/ofSwitch.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/***
/*
Copyright 2014 Cisco Systems Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion ofctrl/ofctrl_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/***
/*
Copyright 2014 Cisco Systems Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
3 changes: 2 additions & 1 deletion ofctrl/ofpacket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion ofctrl/ovsdbDriver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 6becde3

Please sign in to comment.