chore(lint): re-enable staticcheck and unused
ci / lint (pull_request) Successful in 6m32s
ci / image (pull_request) Successful in 6m29s
ci / build (pull_request) Successful in 11m31s
ci / test (pull_request) Successful in 12m59s

golangci-lint v2.15.0 ships a honnef.co/go/tools that analyzes the Go 1.27
standard library without panicking. Fix what they found: dead helpers, an
unused constant, error strings starting with a product name, the usage
error, and two negations simplified by De Morgan.

Closes #43

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-23 07:12:20 +01:00
1 parent 1ad68e2e87
commit d58e3e2653
14 files changed
+20 -25

No files matched your search

+7 -2
View File
@@ -30,6 +30,11 @@ const usage = `usage:
region and agent manage platform resources shared by all organizations;
organizations manage their own in the console.`
// usageError reports a command line the binary does not understand.
type usageError struct{}
func (usageError) Error() string { return usage }
// admin runs operator commands. They act across all organizations, hence the
// system scope, and print to stdout for humans and scripts.
func admin(ctx context.Context, cfg config.API, args []string) error {
@@ -96,7 +101,7 @@ func admin(ctx context.Context, cfg config.API, args []string) error {
return err
})
}
return errors.New(usage)
return usageError{}
}
func createAgent(ctx context.Context, db *tenant.DB, args []string) error {
@@ -108,7 +113,7 @@ func createAgent(ctx context.Context, db *tenant.DB, args []string) error {
return err
}
if *name == "" || (*kind == "checker") != (*region != "") {
return errors.New(usage)
return usageError{}
}
var tok string
err := db.Tx(ctx, tenant.System(), func(q *store.Queries) error {
+1 -1
View File
@@ -50,7 +50,7 @@ func run(log *slog.Logger, level *slog.LevelVar, args []string) error {
return admin(ctx, cfg, args)
case "serve":
default:
return errors.New(usage)
return usageError{}
}
}
+1 -1
View File
@@ -35,7 +35,7 @@ func run(log *slog.Logger, level *slog.LevelVar) error {
return err
}
level.Set(cfg.LogLevel)
if err := cfg.Common.Validate(); err != nil {
if err := cfg.Validate(); err != nil {
return err
}
ctx, stop := platform.SignalContext()
+1 -1
View File
@@ -43,7 +43,7 @@ func run(log *slog.Logger, level *slog.LevelVar) error {
return err
}
level.Set(cfg.LogLevel)
if err := cfg.Common.Validate(); err != nil {
if err := cfg.Validate(); err != nil {
return err
}
ctx, stop := platform.SignalContext()