Skip to content

Commit 11a8430

Browse files
authored
Merge pull request #2614 from alexandear/refactor/use-context
Use "context" instead of "golang.org/x/net/context"
2 parents 59beedd + 2619536 commit 11a8430

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.golangci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ run:
2121
linters:
2222
disable-all: true
2323
enable:
24-
# - depguard # annoying since golangci-lint v1.53.1 https://github.com/golangci/golangci-lint/issues/3877
24+
- depguard
2525
- gofmt
2626
- goimports
2727
- govet
@@ -81,6 +81,12 @@ linters:
8181
# - wrapcheck
8282
# - wsl
8383
linters-settings:
84+
depguard:
85+
rules:
86+
main:
87+
deny:
88+
- pkg: "golang.org/x/net/context"
89+
desc: "use the 'context' package from the standard library"
8490
gocritic:
8591
# See "Tags" section in https://github.com/go-critic/go-critic#usage
8692
enabled-tags:

pkg/portfwd/client.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package portfwd
22

33
import (
4+
"context"
45
"errors"
56
"fmt"
67
"io"
@@ -9,8 +10,6 @@ import (
910
"github.com/lima-vm/lima/pkg/guestagent/api"
1011
guestagentclient "github.com/lima-vm/lima/pkg/guestagent/api/client"
1112
"github.com/sirupsen/logrus"
12-
13-
"golang.org/x/net/context"
1413
)
1514

1615
func HandleTCPConnection(ctx context.Context, client *guestagentclient.GuestAgentClient, conn net.Conn, guestAddr string) {

0 commit comments

Comments
 (0)