From cf3742b6080ba3064a3395f3d0d35ff867a683c7 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Fri, 6 Feb 2026 12:29:17 +0000 Subject: [PATCH] all: add remaining noinlineerr nolint directives Add nolint:noinlineerr to remaining inline error handling patterns: - hscontrol/noise.go: writer.Write and json.Unmarshal - hscontrol/platform_config.go: template.Execute - hscontrol/tailsql.go: tsNode.Up - integration/scenario.go: Headscale() calls in CreatePreAuthKey/CreateUser Co-Authored-By: Claude Opus 4.5 --- hscontrol/noise.go | 4 ++-- hscontrol/platform_config.go | 2 +- hscontrol/tailsql.go | 2 +- integration/scenario.go | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hscontrol/noise.go b/hscontrol/noise.go index fb211d75..1e974408 100644 --- a/hscontrol/noise.go +++ b/hscontrol/noise.go @@ -153,7 +153,7 @@ func (ns *noiseServer) earlyNoise(protocolVersion int, writer io.Writer) error { return err } - if _, err := writer.Write(earlyJSON); err != nil { + if _, err := writer.Write(earlyJSON); err != nil { //nolint:noinlineerr return err } @@ -205,7 +205,7 @@ func (ns *noiseServer) NoisePollNetMapHandler( body, _ := io.ReadAll(req.Body) var mapRequest tailcfg.MapRequest - if err := json.Unmarshal(body, &mapRequest); err != nil { + if err := json.Unmarshal(body, &mapRequest); err != nil { //nolint:noinlineerr httpError(writer, err) return } diff --git a/hscontrol/platform_config.go b/hscontrol/platform_config.go index 113caf4b..74929ea9 100644 --- a/hscontrol/platform_config.go +++ b/hscontrol/platform_config.go @@ -94,7 +94,7 @@ func (h *Headscale) ApplePlatformConfig( } var content bytes.Buffer - if err := commonTemplate.Execute(&content, config); err != nil { + if err := commonTemplate.Execute(&content, config); err != nil { //nolint:noinlineerr httpError(writer, err) return } diff --git a/hscontrol/tailsql.go b/hscontrol/tailsql.go index 2e3509a2..d6ef380e 100644 --- a/hscontrol/tailsql.go +++ b/hscontrol/tailsql.go @@ -54,7 +54,7 @@ func runTailSQLService(ctx context.Context, logf logger.Logf, stateDir, dbPath s // Make sure the Tailscale node starts up. It might not, if it is a new node // and the user did not provide an auth key. - if st, err := tsNode.Up(ctx); err != nil { + if st, err := tsNode.Up(ctx); err != nil { //nolint:noinlineerr return fmt.Errorf("starting tailscale: %w", err) } else { logf("tailscale started, node state %q", st.BackendState) diff --git a/integration/scenario.go b/integration/scenario.go index 19541591..dd07f50b 100644 --- a/integration/scenario.go +++ b/integration/scenario.go @@ -480,7 +480,7 @@ func (s *Scenario) CreatePreAuthKey( reusable bool, ephemeral bool, ) (*v1.PreAuthKey, error) { - if headscale, err := s.Headscale(); err == nil { + if headscale, err := s.Headscale(); err == nil { //nolint:noinlineerr key, err := headscale.CreateAuthKey(user, reusable, ephemeral) if err != nil { return nil, fmt.Errorf("creating user: %w", err) @@ -532,7 +532,7 @@ func (s *Scenario) CreatePreAuthKeyWithTags( // CreateUser creates a User to be created in the // Headscale instance on behalf of the Scenario. func (s *Scenario) CreateUser(user string) (*v1.User, error) { - if headscale, err := s.Headscale(); err == nil { + if headscale, err := s.Headscale(); err == nil { //nolint:noinlineerr u, err := headscale.CreateUser(user) if err != nil { return nil, fmt.Errorf("creating user: %w", err)