build: update golangci-lint to v2.12.2 with commit-pinned installs
All checks were successful
check / check (push) Successful in 1m0s
All checks were successful
check / check (push) Successful in 1m0s
Pin golangci-lint to commit c0d3ddc9cf3faa61a4e378e879ece580256d76e5 (v2.12.2) in Dockerfile and script/bootstrap. Fix the goconst findings the new version reports under the unchanged canonical .golangci.yml by extracting shared test fixture constants and a statusError constant in the watcher.
This commit is contained in:
@@ -26,6 +26,9 @@ const tlsPort = 443
|
||||
// hoursPerDay converts days to hours for duration calculations.
|
||||
const hoursPerDay = 24
|
||||
|
||||
// statusError is the status value recorded for failed checks.
|
||||
const statusError = "error"
|
||||
|
||||
// Params contains dependencies for Watcher.
|
||||
type Params struct {
|
||||
fx.In
|
||||
@@ -421,7 +424,7 @@ func (w *Watcher) detectNSDisappearances(
|
||||
|
||||
for ns := range current {
|
||||
prevNS, ok := prev.RecordsByNameserver[ns]
|
||||
if !ok || prevNS.Status != "error" {
|
||||
if !ok || prevNS.Status != statusError {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -721,7 +724,7 @@ func (w *Watcher) handleTLSError(
|
||||
|
||||
w.state.SetCertificateState(
|
||||
certKey, &state.CertificateState{
|
||||
Status: "error",
|
||||
Status: statusError,
|
||||
Error: err.Error(),
|
||||
LastChecked: now,
|
||||
},
|
||||
@@ -760,7 +763,7 @@ func (w *Watcher) detectTLSChanges(
|
||||
prev *state.CertificateState,
|
||||
cert *tlscheck.CertificateInfo,
|
||||
) {
|
||||
if prev.Status == "error" {
|
||||
if prev.Status == statusError {
|
||||
msg := fmt.Sprintf(
|
||||
"Host: %s\nIP: %s\nTLS recovered",
|
||||
hostname, ip,
|
||||
|
||||
Reference in New Issue
Block a user