fix: resolve golangci-lint errors (batch 2)
- modules/operations: use modules/json, maps.Copy - modules/circuitbreaker: use omitzero - modules/structs: fix VerifiedAt omitzero tag - routers/api/v1/repo: update VerifiedAt field name 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
81bb23f0da
commit
58a3cb17e8
@ -281,7 +281,7 @@ type Stats struct {
|
||||
State string `json:"state"`
|
||||
Failures int `json:"failures"`
|
||||
Successes int `json:"successes"`
|
||||
LastFailure time.Time `json:"last_failure,omitempty"`
|
||||
LastFailure time.Time `json:"last_failure,omitzero"`
|
||||
LastStateChange time.Time `json:"last_state_change"`
|
||||
Generation uint64 `json:"generation"`
|
||||
}
|
||||
|
||||
@ -7,12 +7,13 @@ package operations
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"maps"
|
||||
"net/http"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/gitea/modules/json"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
)
|
||||
|
||||
@ -354,11 +355,7 @@ func (op *Operation) Complete(result map[string]any) {
|
||||
op.phases[i].Status = StatusComplete
|
||||
op.phases[i].Progress = 100
|
||||
}
|
||||
if result != nil {
|
||||
for k, v := range result {
|
||||
op.metadata[k] = v
|
||||
}
|
||||
}
|
||||
maps.Copy(op.metadata, result)
|
||||
op.updatedAt = time.Now()
|
||||
op.mu.Unlock()
|
||||
op.broadcast()
|
||||
|
||||
@ -22,7 +22,7 @@ type PagesDomain struct {
|
||||
SSLStatus string `json:"ssl_status"`
|
||||
SSLCertExpiry time.Time `json:"ssl_cert_expiry,omitzero"`
|
||||
Created time.Time `json:"created_at"`
|
||||
VerifiedAt time.Time `json:"verified_at,omitempty"`
|
||||
VerifiedAt time.Time `json:"verified_at,omitzero"`
|
||||
}
|
||||
|
||||
// CreatePagesConfigOption options for creating/updating pages config
|
||||
|
||||
@ -374,7 +374,7 @@ func convertPagesDomain(domain *repo_model.PagesDomain) *api.PagesDomain {
|
||||
SSLStatus: string(domain.SSLStatus),
|
||||
SSLCertExpiry: domain.SSLCertExpiry.AsTime(),
|
||||
Created: domain.CreatedUnix.AsTime(),
|
||||
Verified_At: domain.VerifiedUnix.AsTime(),
|
||||
VerifiedAt: domain.VerifiedUnix.AsTime(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user