chore(lint): re-enable staticcheck and unused
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:
1 parent
1ad68e2e87
commit
d58e3e2653
14 files changed
+20
-25
No files matched your search
+7
-2
@@ -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
@@ -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{}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user