chore(lint): add containedctx, decorder and errchkjson
This commit is contained in:
@@ -9,6 +9,7 @@ issues:
|
||||
- dupl
|
||||
- maligned
|
||||
- goerr113
|
||||
- containedctx
|
||||
- path: internal/server/
|
||||
linters:
|
||||
- dupl
|
||||
@@ -49,9 +50,12 @@ linters:
|
||||
- asciicheck
|
||||
- bidichk
|
||||
- bodyclose
|
||||
- containedctx
|
||||
- decorder
|
||||
- dogsled
|
||||
- dupl
|
||||
- durationcheck
|
||||
- errchkjson
|
||||
- errname
|
||||
- exhaustive
|
||||
- exportloopref
|
||||
@@ -71,9 +75,11 @@ linters:
|
||||
- gomoddirectives
|
||||
- goprintffuncname
|
||||
- gosec
|
||||
- grouper
|
||||
- ifshort
|
||||
- importas
|
||||
- lll
|
||||
- maintidx
|
||||
- makezero
|
||||
- misspell
|
||||
- nakedret
|
||||
|
||||
@@ -122,7 +122,7 @@ var (
|
||||
errCommandUnknown = errors.New("command is unknown")
|
||||
)
|
||||
|
||||
//nolint:gocognit,gocyclo
|
||||
//nolint:gocognit,gocyclo,maintidx
|
||||
func _main(ctx context.Context, buildInfo models.BuildInformation,
|
||||
args []string, logger logging.ParentLogger, source sources.Source,
|
||||
tun tun.Interface, netLinker netlink.NetLinker, cmder command.RunStarter,
|
||||
|
||||
@@ -25,7 +25,7 @@ func newHandler(ctx context.Context, wg *sync.WaitGroup, logger Logger,
|
||||
}
|
||||
|
||||
type handler struct {
|
||||
ctx context.Context
|
||||
ctx context.Context //nolint:containedctx
|
||||
wg *sync.WaitGroup
|
||||
client *http.Client
|
||||
logger Logger
|
||||
|
||||
@@ -19,7 +19,7 @@ func newDNSHandler(ctx context.Context, looper dns.Looper,
|
||||
}
|
||||
|
||||
type dnsHandler struct {
|
||||
ctx context.Context
|
||||
ctx context.Context //nolint:containedctx
|
||||
looper dns.Looper
|
||||
warner warner
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ func newHandlerV0(ctx context.Context, logger infoWarner,
|
||||
}
|
||||
|
||||
type handlerV0 struct {
|
||||
ctx context.Context
|
||||
ctx context.Context //nolint:containedctx
|
||||
logger infoWarner
|
||||
vpn vpn.Looper
|
||||
dns dns.Looper
|
||||
|
||||
@@ -21,7 +21,7 @@ func newOpenvpnHandler(ctx context.Context, looper vpn.Looper,
|
||||
}
|
||||
|
||||
type openvpnHandler struct {
|
||||
ctx context.Context
|
||||
ctx context.Context //nolint:containedctx
|
||||
looper vpn.Looper
|
||||
pf portforward.Getter
|
||||
warner warner
|
||||
|
||||
@@ -21,7 +21,7 @@ func newUpdaterHandler(
|
||||
}
|
||||
|
||||
type updaterHandler struct {
|
||||
ctx context.Context
|
||||
ctx context.Context //nolint:containedctx
|
||||
looper updater.Looper
|
||||
warner warner
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ var (
|
||||
errDecodeProvider = errors.New("cannot decode servers for provider")
|
||||
)
|
||||
|
||||
func (s *Storage) extractServersFromBytes(b []byte, hardcoded models.AllServers) ( //nolint:gocognit,gocyclo
|
||||
func (s *Storage) extractServersFromBytes(b []byte, hardcoded models.AllServers) ( //nolint:gocognit,gocyclo,maintidx
|
||||
servers models.AllServers, err error) {
|
||||
var versions allVersions
|
||||
if err := json.Unmarshal(b, &versions); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user