fix(ci): fix lint errors and pin CI to Go 1.25
- Run gofmt on all files - Export SetupUPnP to fix unused lint error - Remove Go 1.26 from CI matrix (only test with 1.25)
This commit is contained in:
parent
3e0f3a5a64
commit
d0dbfc3d12
10 changed files with 31 additions and 31 deletions
|
|
@ -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 }
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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 },
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue