Skip to content

Commit

Permalink
Fix golangci-lint 1.54.2 errors
Browse files Browse the repository at this point in the history
Ignore this one as the aliasing is OK here:

pkg/cable/wireguard/getconnections.go:66:28:
    G601: Implicit memory aliasing in for loop. (gosec)
        if k, err := keyFromSpec(&con.Endpoint); err == nil {
		                         ^
pkg/netlink/fake/netlink.go:56:2: directive `//nolint:errorlint...` is
   unused for linter "errorlint" (nolintlint)
       //nolint:errorlint // The given error should not be wrapped.

Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
  • Loading branch information
tpantelis committed Aug 22, 2023
1 parent a4fb495 commit 8465f26
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/cable/wireguard/getconnections.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (w *wireguard) GetConnections() ([]v1.Connection, error) {

func (w *wireguard) connectionByKey(key *wgtypes.Key) (*v1.Connection, error) {
for cid, con := range w.connections {
if k, err := keyFromSpec(&con.Endpoint); err == nil {
if k, err := keyFromSpec(&con.Endpoint); err == nil { //nolint:gosec // Implicit aliasing OK here
if key.String() == k.String() {
return con, nil
}
Expand Down
1 change: 0 additions & 1 deletion pkg/netlink/fake/netlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ func (e linkNotFoundError) Error() string {
}

func (e linkNotFoundError) Is(err error) bool {
//nolint:errorlint // The given error should not be wrapped.
_, ok := err.(netlink.LinkNotFoundError)
return ok
}
Expand Down

0 comments on commit 8465f26

Please sign in to comment.