1
0
mirror of https://github.com/juanfont/headscale.git synced 2026-02-07 20:04:00 +01:00
juanfont.headscale/cmd/headscale/cli
Kristoffer Dalby 164a7c9dbd all: fix golangci-lint issues (noctx, unused, unparam, goconst, prealloc, predeclared, gocritic)
This commit fixes multiple golangci-lint issues:

- noctx: Use context-aware functions (exec.CommandContext, db.ExecContext,
  db.PingContext, db.QueryRowContext, net.ListenConfig.Listen,
  http.NewRequestWithContext, net.Resolver.LookupIPAddr)
- unused: Remove unused mockState type and methods in mapper_test.go,
  unused createTestNodeSimple in maprequest_test.go, unused batchSize const
- unparam: Remove unused error returns (nodeRoutesToPtables,
  parseUpdateAndAnalyze, renderOIDCCallbackTemplate), remove unused parameters
  (drainChannelTimeout name, requireAllClientsOfflineStaged message/timeout,
  node hostinfo, Protocol.parseProtocol bool return)
- goconst: Extract repeated strings to constants (defaultTestNodePrefix,
  stateOnline, stateOffline, testUnknownNode)
- prealloc: Preallocate slices where beneficial (PolicyManagerFuncsForTest,
  routes slice, command slice, testCases)
- predeclared: Rename min/max variables to minVal/maxVal to avoid shadowing
  Go 1.21+ built-ins
- gocritic: Add nolint comment for exitAfterDefer in app.go initialization
- noinlineerr: Refactor inline error handling to use plain assignment
- nosprintfhostport: Use net.JoinHostPort for URL construction
- gosec G115: Add nolint comment for safe integer conversion

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 09:37:22 +00:00
..
api_key.go all: fix golangci-lint issues (batch 1) 2026-02-06 07:13:22 +00:00
configtest.go all: use lowercase log messages 2026-02-06 07:40:29 +01:00
debug.go all: apply golangci-lint fixes 2026-02-06 06:54:44 +00:00
dump_config.go add integration test for headscale -c 2022-06-05 23:13:58 +08:00
generate.go feat(aliases): add 'gen' alias for 'generate' command 2022-03-02 14:29:33 +10:00
health.go add health command (#2659) 2025-10-16 12:00:11 +00:00
mockoidc.go all: fix golangci-lint issues (noctx, unused, unparam, goconst, prealloc, predeclared, gocritic) 2026-02-06 09:37:22 +00:00
nodes.go all: fix golangci-lint issues (noctx, unused, unparam, goconst, prealloc, predeclared, gocritic) 2026-02-06 09:37:22 +00:00
policy.go all: apply golangci-lint fixes 2026-02-06 06:54:44 +00:00
preauthkeys.go Remove trace log for preauthkeys create 2026-01-23 08:40:09 +01:00
pterm_style.go Fix lint 2022-02-12 19:42:55 +00:00
root_test.go cli: do not show new pre-releases on stable (#2813) 2025-10-24 13:15:53 +02:00
root.go all: apply golangci-lint fixes 2026-02-06 06:54:44 +00:00
serve.go all: use lowercase log messages 2026-02-06 07:40:29 +01:00
users.go cmd,hscontrol: fix err113 lint issues (batch 8) 2026-02-06 08:01:58 +00:00
utils.go all: apply golangci-lint fixes 2026-02-06 06:54:44 +00:00
version.go cli: use gobuild version handling (#2770) 2025-09-12 11:47:31 +02:00