diff options
| author | Paul Buetow <paul@buetow.org> | 2026-04-14 11:23:26 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-04-14 11:23:26 +0300 |
| commit | 17efa78e8e60b38e14430f2f89de005e946e8bf2 (patch) | |
| tree | a8b8c76122b32ed570e2926fb266dfb563b136b0 /internal/cli | |
| parent | c19666bd44b938ab2627b0c85935d3877c88b373 (diff) | |
fix: shadowing, version.Tag, prealloc LoadRecords (ask 54)
- CreateKey: avoid shadowing named return err on rand.Read
- daemon Run: rename slog logger to slogLog vs stdlib log package
- version: rename Version to Tag to avoid version.Version stutter
- LoadRecords: COUNT(*) then make slice with capacity
Made-with: Cursor
Diffstat (limited to 'internal/cli')
| -rw-r--r-- | internal/cli/cli.go | 2 | ||||
| -rw-r--r-- | internal/cli/cli_test.go | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/internal/cli/cli.go b/internal/cli/cli.go index 81ebc40..3c686db 100644 --- a/internal/cli/cli.go +++ b/internal/cli/cli.go @@ -20,7 +20,7 @@ import ( func Execute(args []string) error { // Handle version flag early. if len(args) > 0 && (args[0] == "-version" || args[0] == "--version") { - fmt.Println(version.Version) + fmt.Println(version.Tag) return nil } if len(args) >= 1 && (args[0] == "--create-client-key" || args[0] == "-create-client-key") { diff --git a/internal/cli/cli_test.go b/internal/cli/cli_test.go index a89fa50..9f3fd6d 100644 --- a/internal/cli/cli_test.go +++ b/internal/cli/cli_test.go @@ -62,8 +62,8 @@ func TestStableVersionFlags(t *testing.T) { t.Fatalf("Execute: %v", err) } }) - if !strings.Contains(out, version.Version) { - t.Fatalf("stdout %q should contain version %q", out, version.Version) + if !strings.Contains(out, version.Tag) { + t.Fatalf("stdout %q should contain version %q", out, version.Tag) } }) } |
