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:
Steve Yegge
2025-10-25 13:33:51 -07:00
parent 94fb9fa531
commit 47c915ef10
10 changed files with 79 additions and 62 deletions

View File

@@ -11,6 +11,8 @@ import (
"github.com/steveyegge/beads/internal/types"
)
const testUserAlice = "alice"
func TestCommentsCommand(t *testing.T) {
tmpDir, err := os.MkdirTemp("", "bd-test-comments-*")
if err != nil {
@@ -41,7 +43,7 @@ func TestCommentsCommand(t *testing.T) {
}
t.Run("add comment", func(t *testing.T) {
comment, err := s.AddIssueComment(ctx, issue.ID, "alice", "This is a test comment")
comment, err := s.AddIssueComment(ctx, issue.ID, testUserAlice, "This is a test comment")
if err != nil {
t.Fatalf("Failed to add comment: %v", err)
}
@@ -49,7 +51,7 @@ func TestCommentsCommand(t *testing.T) {
if comment.IssueID != issue.ID {
t.Errorf("Expected issue ID %s, got %s", issue.ID, comment.IssueID)
}
if comment.Author != "alice" {
if comment.Author != testUserAlice {
t.Errorf("Expected author alice, got %s", comment.Author)
}
if comment.Text != "This is a test comment" {