chore(lint): add containedctx, decorder and errchkjson

This commit is contained in:
Quentin McGaw
2022-02-26 13:49:53 +00:00
parent 26b049b361
commit 836f021a87
8 changed files with 13 additions and 7 deletions

View File

@@ -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

View File

@@ -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
}

View File

@@ -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

View File

@@ -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

View File

@@ -21,7 +21,7 @@ func newUpdaterHandler(
}
type updaterHandler struct {
ctx context.Context
ctx context.Context //nolint:containedctx
looper updater.Looper
warner warner
}

View File

@@ -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 {