Skip to content

Commit d37736e

Browse files
authored
CHORE: Linting (#3645)
1 parent 0d60e0c commit d37736e

File tree

4 files changed

+16
-18
lines changed

4 files changed

+16
-18
lines changed

build/generate/featureMatrix.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import (
1212
)
1313

1414
func generateFeatureMatrix() error {
15-
var replacementContent string = "Jump to a table:\n\n"
15+
var replacementContent = "Jump to a table:\n\n"
1616
matrix := matrixData()
1717

1818
for _, tableTitle := range matrix.FeatureTablesTitles {
19-
var jumptotableContent string = ""
19+
var jumptotableContent = ""
2020

21-
var anchor string = strings.ToLower(tableTitle)
21+
var anchor = strings.ToLower(tableTitle)
2222
anchor = strings.Replace(anchor, " ", "-", -1)
2323

2424
jumptotableContent += fmt.Sprintf("- [%s](#%s)\n", tableTitle, anchor)

pkg/acme/acme.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,6 @@ func getCertInfo(pemBytes []byte) (names []string, remaining float64, err error)
183183
if err != nil {
184184
return nil, 0, err
185185
}
186-
//lint:ignore S1024 Fixing this without unit tests scares me.
187-
// TODO(tlim): I think the fix is the line below but since this code
188-
// may be decommed eventually, and since there are no unit tests,
189-
// I'm not excited about making this change.
190-
// var daysLeft = float64(time.Until(cert.NotAfter)) / float64(time.Hour*24)
191186
daysLeft := float64(time.Until(cert.NotAfter)) / float64(time.Hour*24)
192187
return cert.DNSNames, daysLeft, nil
193188
}
@@ -303,10 +298,13 @@ func (c *certManager) getAndRunCorrections(d *models.DomainConfig) error {
303298
for _, corr := range cs {
304299
fmt.Printf("Running [%s]\n", corr.Msg)
305300
err = corr.F()
306-
c.notifier.Notify(d.Name, "certs", corr.Msg, err, false)
301+
err2 := c.notifier.Notify(d.Name, "certs", corr.Msg, err, false)
307302
if err != nil {
308303
return err
309304
}
305+
if err2 != nil {
306+
return err2
307+
}
310308
}
311309
return nil
312310
}

providers/dnsmadeeasy/api.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func (api *dnsMadeEasyProvider) domainExists(name string) (bool, error) {
7171
return ok, nil
7272
}
7373

74-
func (api *dnsMadeEasyProvider) findDomainId(name string) (int, error) {
74+
func (api *dnsMadeEasyProvider) findDomainID(name string) (int, error) {
7575
if err := api.loadDomains(); err != nil {
7676
return 0, err
7777
}
@@ -85,12 +85,12 @@ func (api *dnsMadeEasyProvider) findDomainId(name string) (int, error) {
8585
}
8686

8787
func (api *dnsMadeEasyProvider) fetchDomainRecords(domainName string) ([]recordResponseDataEntry, error) {
88-
domainId, err := api.findDomainId(domainName)
88+
domainID, err := api.findDomainID(domainName)
8989
if err != nil {
9090
return nil, err
9191
}
9292

93-
res, err := api.restAPI.recordGet(domainId)
93+
res, err := api.restAPI.recordGet(domainID)
9494
if err != nil {
9595
return nil, fmt.Errorf("fetching records failed: %w", err)
9696
}
@@ -108,12 +108,12 @@ func (api *dnsMadeEasyProvider) fetchDomainRecords(domainName string) ([]recordR
108108
}
109109

110110
func (api *dnsMadeEasyProvider) fetchDomainNameServers(domainName string) ([]string, error) {
111-
domainId, err := api.findDomainId(domainName)
111+
domainID, err := api.findDomainID(domainName)
112112
if err != nil {
113113
return nil, err
114114
}
115115

116-
res, err := api.restAPI.singleDomainGet(domainId)
116+
res, err := api.restAPI.singleDomainGet(domainID)
117117
if err != nil {
118118
return nil, fmt.Errorf("fetching domain from DNSMADEEASY failed: %w", err)
119119
}

providers/dnsmadeeasy/dnsMadeEasyProvider.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func New(settings map[string]string, _ json.RawMessage) (providers.DNSServicePro
105105

106106
func (api *dnsMadeEasyProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, existingRecords models.Records) ([]*models.Correction, int, error) {
107107
domainName := dc.Name
108-
domainId, err := api.findDomainId(domainName)
108+
domainID, err := api.findDomainID(domainName)
109109
if err != nil {
110110
return nil, 0, err
111111
}
@@ -139,7 +139,7 @@ func (api *dnsMadeEasyProvider) GetZoneRecordsCorrections(dc *models.DomainConfi
139139
corr := &models.Correction{
140140
Msg: strings.Join(deleteDescription, "\n\t"),
141141
F: func() error {
142-
return api.deleteRecords(domainId, deleteRecordIds)
142+
return api.deleteRecords(domainID, deleteRecordIds)
143143
},
144144
}
145145
corrections = append(corrections, corr)
@@ -157,7 +157,7 @@ func (api *dnsMadeEasyProvider) GetZoneRecordsCorrections(dc *models.DomainConfi
157157
corr := &models.Correction{
158158
Msg: strings.Join(createDescription, "\n\t"),
159159
F: func() error {
160-
return api.createRecords(domainId, createRecords)
160+
return api.createRecords(domainID, createRecords)
161161
},
162162
}
163163
corrections = append(corrections, corr)
@@ -180,7 +180,7 @@ func (api *dnsMadeEasyProvider) GetZoneRecordsCorrections(dc *models.DomainConfi
180180
corr := &models.Correction{
181181
Msg: strings.Join(modifyDescription, "\n\t"),
182182
F: func() error {
183-
return api.updateRecords(domainId, modifyRecords)
183+
return api.updateRecords(domainID, modifyRecords)
184184
},
185185
}
186186
corrections = append(corrections, corr)

0 commit comments

Comments
 (0)