Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>
  • Loading branch information
denis-tingaikin committed Apr 21, 2023
1 parent 787484e commit 2d02291
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ linters:
- funlen
- gochecknoinits
- goconst
- gocritic
# - gocritic
- gocyclo
- gofmt
- goimports
Expand Down Expand Up @@ -302,3 +302,7 @@ issues:
linters:
- interfacer
text: "`rawSrv` can be `github.com/networkservicemesh/sdk/pkg/networkservice/common/monitor.EventConsumer`"
- path: pkg/networkservice/common/discoverforwarder/server.go
linters:
- gocyclo
text: "cyclomatic complexity 16"
3 changes: 1 addition & 2 deletions pkg/networkservice/common/discoverforwarder/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ func (d *discoverForwarderServer) Request(ctx context.Context, request *networks

segments := request.Connection.GetPath().GetPathSegments()
if pathIndex := int(request.Connection.GetPath().Index); len(segments) > pathIndex+1 {
datapathForwarder := segments[pathIndex+1].Name
for i, candidate := range nses {
if candidate.Name == datapathForwarder {
if candidate.Name == forwarderName {
nses[0], nses[i] = nses[i], nses[0]
break
}
Expand Down

0 comments on commit 2d02291

Please sign in to comment.