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

+7-1
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

+1-2
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)