Fix goconst linter warnings by converting repeated strings to constants
- Added testUserAlice constant for 'alice' in test files - Added windowsOS constant for 'windows' in test files - Added testIssueBD1/testIssueBD2 constants for 'bd-1'/'bd-2' in test files - Added testVersion100 constant for '1.0.0' in version tests - Added testIssueCustom1 constant for 'custom-1' in lazy init tests Closes bd-54 Amp-Thread-ID: https://ampcode.com/threads/T-0a4e5d44-2d95-4948-8f4a-d8facf8657c7 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -7,6 +7,8 @@ import (
|
||||
"github.com/steveyegge/beads/internal/types"
|
||||
)
|
||||
|
||||
const testUserAlice = "alice"
|
||||
|
||||
func TestAddComment(t *testing.T) {
|
||||
store, cleanup := setupTestDB(t)
|
||||
defer cleanup()
|
||||
@@ -26,7 +28,7 @@ func TestAddComment(t *testing.T) {
|
||||
}
|
||||
|
||||
// Add a comment
|
||||
err = store.AddComment(ctx, issue.ID, "alice", "This is a test comment")
|
||||
err = store.AddComment(ctx, issue.ID, testUserAlice, "This is a test comment")
|
||||
if err != nil {
|
||||
t.Fatalf("AddComment failed: %v", err)
|
||||
}
|
||||
@@ -55,7 +57,7 @@ func TestAddComment(t *testing.T) {
|
||||
t.Fatal("Comment event not found")
|
||||
}
|
||||
|
||||
if commentEvent.Actor != "alice" {
|
||||
if commentEvent.Actor != testUserAlice {
|
||||
t.Errorf("Expected actor 'alice', got '%s'", commentEvent.Actor)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user