diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16285bf..b23461d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: ["1.25", "1.26"] + go-version: ["1.25"] steps: - uses: actions/checkout@v6 diff --git a/internal/agent/client_test.go b/internal/agent/client_test.go index c8ce68d..c7ff470 100644 --- a/internal/agent/client_test.go +++ b/internal/agent/client_test.go @@ -531,7 +531,7 @@ func TestBatchDownload(t *testing.T) { t.Errorf("path = %s", r.URL.Path) } json.NewEncoder(w).Encode(BatchDownloadResponse{ - Queued: 3, + Queued: 3, NotFound: 1, }) })) diff --git a/internal/cmd/daemon_test.go b/internal/cmd/daemon_test.go index 11ad2a5..fe1cdd4 100644 --- a/internal/cmd/daemon_test.go +++ b/internal/cmd/daemon_test.go @@ -9,8 +9,8 @@ func TestDeriveWSURL(t *testing.T) { want string }{ {"https://torrentclaw.com", "agent-123", "wss://unarr.torrentclaw.com/ws/agent-123"}, - {"http://localhost:3000", "a1", ""}, // localhost skipped - {"http://127.0.0.1:3000", "a1", ""}, // 127.0.0.1 skipped + {"http://localhost:3000", "a1", ""}, // localhost skipped + {"http://127.0.0.1:3000", "a1", ""}, // 127.0.0.1 skipped {"https://torrentclaw.com/", "a1", "wss://unarr.torrentclaw.com/ws/a1"}, {"https://api.example.io", "x", "wss://unarr.api.example.io/ws/x"}, {"", "agent-123", ""}, diff --git a/internal/engine/manager_test.go b/internal/engine/manager_test.go index 84bcc18..5989757 100644 --- a/internal/engine/manager_test.go +++ b/internal/engine/manager_test.go @@ -301,6 +301,6 @@ func (m *slowMockDownloader) Download(ctx context.Context, _ *Task, _ string, _ <-ctx.Done() return nil, ctx.Err() } -func (m *slowMockDownloader) Pause(_ string) error { return nil } -func (m *slowMockDownloader) Cancel(_ string) error { return nil } +func (m *slowMockDownloader) Pause(_ string) error { return nil } +func (m *slowMockDownloader) Cancel(_ string) error { return nil } func (m *slowMockDownloader) Shutdown(_ context.Context) error { return nil } diff --git a/internal/engine/progress.go b/internal/engine/progress.go index 264de2f..6f958c9 100644 --- a/internal/engine/progress.go +++ b/internal/engine/progress.go @@ -41,10 +41,10 @@ type ProgressReporter struct { onStreamRequested ActionFunc onWatchingChanged func(watching bool) - mu sync.Mutex - latest map[string]*Task // taskID -> task with latest progress - lastReported map[string]TaskStatus // taskID -> last status sent to API - lastCheckAt time.Time // last time we reported for control-signal polling + mu sync.Mutex + latest map[string]*Task // taskID -> task with latest progress + lastReported map[string]TaskStatus // taskID -> last status sent to API + lastCheckAt time.Time // last time we reported for control-signal polling } // NewProgressReporter creates a reporter that flushes every interval. diff --git a/internal/engine/progress_test.go b/internal/engine/progress_test.go index 1bb36c6..e9e1add 100644 --- a/internal/engine/progress_test.go +++ b/internal/engine/progress_test.go @@ -230,10 +230,10 @@ func TestProgressReporter_HandleResponseDeleteFiles(t *testing.T) { var deletedID string pr := &ProgressReporter{ - reporter: reporter, - interval: time.Second, - latest: make(map[string]*Task), - lastReported: make(map[string]TaskStatus), + reporter: reporter, + interval: time.Second, + latest: make(map[string]*Task), + lastReported: make(map[string]TaskStatus), onDeleteFiles: func(id string) { deletedID = id }, } @@ -254,10 +254,10 @@ func TestProgressReporter_HandleResponseStream(t *testing.T) { var streamID string pr := &ProgressReporter{ - reporter: reporter, - interval: time.Second, - latest: make(map[string]*Task), - lastReported: make(map[string]TaskStatus), + reporter: reporter, + interval: time.Second, + latest: make(map[string]*Task), + lastReported: make(map[string]TaskStatus), onStreamRequested: func(id string) { streamID = id }, } diff --git a/internal/engine/upnp.go b/internal/engine/upnp.go index 1171cf8..9211bd4 100644 --- a/internal/engine/upnp.go +++ b/internal/engine/upnp.go @@ -17,9 +17,9 @@ type UPnPMapping struct { device upnp.Device } -// setupUPnP discovers the gateway, maps the port, and gets the public IP. +// SetupUPnP discovers the gateway, maps the port, and gets the public IP. // Returns nil if UPnP is not available or fails. -func setupUPnP(internalPort int) (*UPnPMapping, error) { +func SetupUPnP(internalPort int) (*UPnPMapping, error) { log.Println("stream: discovering UPnP gateway (10s timeout)...") devices := upnp.Discover(0, 10*time.Second, alog.Logger{}) if len(devices) == 0 { diff --git a/internal/ui/format_test.go b/internal/ui/format_test.go index e5c9eda..a5633d4 100644 --- a/internal/ui/format_test.go +++ b/internal/ui/format_test.go @@ -275,7 +275,7 @@ func TestFormatTimeAgo(t *testing.T) { now := time.Now() tests := []struct { - name string + name string input string want string }{ @@ -356,6 +356,6 @@ func TestPtr(t *testing.T) { } } -func ptr[T any](v T) *T { return &v } -func intPtr(v int) *int { return &v } +func ptr[T any](v T) *T { return &v } +func intPtr(v int) *int { return &v } func strPtr(v string) *string { return &v } diff --git a/internal/usenet/nzb/parser_test.go b/internal/usenet/nzb/parser_test.go index 6afeef0..f14b64a 100644 --- a/internal/usenet/nzb/parser_test.go +++ b/internal/usenet/nzb/parser_test.go @@ -753,9 +753,9 @@ func TestIsSampleFile(t *testing.T) { {"movie-sample-video.mkv", true}, {"movie_sample.mkv", true}, {"sample.mkv", true}, - {"resampled.mkv", false}, // "sample" is part of "resampled" + {"resampled.mkv", false}, // "sample" is part of "resampled" {"movie.mkv", false}, - {"my.samples.zip", false}, // "sample" followed by 's' (alphanumeric) + {"my.samples.zip", false}, // "sample" followed by 's' (alphanumeric) } for _, tt := range tests { if got := isSampleFile(tt.name); got != tt.want { @@ -880,15 +880,15 @@ func TestIsRarFile_Extended(t *testing.T) { name string want bool }{ - {"file.RAR", true}, // case insensitive + {"file.RAR", true}, // case insensitive {"file.Rar", true}, {"file.s01", true}, {"file.s99", true}, {"file.002", true}, {"file.999", true}, - {"file.r0", false}, // too short extension - {"file.rXX", false}, // non-numeric - {"file", false}, // no extension + {"file.r0", false}, // too short extension + {"file.rXX", false}, // non-numeric + {"file", false}, // no extension {"file.mp4", false}, } for _, tt := range tests { diff --git a/internal/usenet/postprocess/pipeline_test.go b/internal/usenet/postprocess/pipeline_test.go index f1a6f26..f3c0cc9 100644 --- a/internal/usenet/postprocess/pipeline_test.go +++ b/internal/usenet/postprocess/pipeline_test.go @@ -14,12 +14,12 @@ func TestFindPar2File(t *testing.T) { vol1 := filepath.Join(dir, "content.vol000+01.par2") vol2 := filepath.Join(dir, "content.vol001+02.par2") - os.WriteFile(mainPar2, make([]byte, 100), 0o644) // smallest + os.WriteFile(mainPar2, make([]byte, 100), 0o644) // smallest os.WriteFile(vol1, make([]byte, 10000), 0o644) os.WriteFile(vol2, make([]byte, 50000), 0o644) files := map[string]string{ - "content.par2": mainPar2, + "content.par2": mainPar2, "content.vol000+01.par2": vol1, "content.vol001+02.par2": vol2, }