Skip to content

Commit d30674b

Browse files
chore(codebase): enable linter recvcheck (#5522)
* chore(codebase): enable linter recvcheck Signed-off-by: ivan katliarchuk <[email protected]> * chore(codebase): enable linter recvcheck Signed-off-by: ivan katliarchuk <[email protected]> * chore(codebase): enable linter recvcheck Signed-off-by: ivan katliarchuk <[email protected]> --------- Signed-off-by: ivan katliarchuk <[email protected]>
1 parent 7108979 commit d30674b

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ linters:
1111
- ineffassign
1212
- misspell
1313
- revive
14+
- recvcheck # Checks for receiver type consistency. https://golangci-lint.run/usage/linters/#recvcheck
1415
- rowserrcheck # Checks whether Rows.Err of rows is checked successfully.
1516
- errchkjson # Checks types passed to the json encoding functions. ref: https://golangci-lint.run/usage/linters/#errchkjson
1617
- errorlint # Checking for unchecked errors in Go code https://golangci-lint.run/usage/linters/#errcheck

plan/plan.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ func (t planTableRow) String() string {
124124
return fmt.Sprintf("planTableRow{current=%v, candidates=%v}", t.current, t.candidates)
125125
}
126126

127-
func (t planTable) addCurrent(e *endpoint.Endpoint) {
127+
func (t *planTable) addCurrent(e *endpoint.Endpoint) {
128128
key := t.newPlanKey(e)
129129
t.rows[key].current = append(t.rows[key].current, e)
130130
t.rows[key].records[e.RecordType].current = e
131131
}
132132

133-
func (t planTable) addCandidate(e *endpoint.Endpoint) {
133+
func (t *planTable) addCandidate(e *endpoint.Endpoint) {
134134
key := t.newPlanKey(e)
135135
t.rows[key].candidates = append(t.rows[key].candidates, e)
136136
t.rows[key].records[e.RecordType].candidates = append(t.rows[key].records[e.RecordType].candidates, e)
@@ -316,7 +316,7 @@ func (p *Plan) shouldUpdateProviderSpecific(desired, current *endpoint.Endpoint)
316316
}
317317

318318
// filterRecordsForPlan removes records that are not relevant to the planner.
319-
// Currently this just removes TXT records to prevent them from being
319+
// Currently, this just removes TXT records to prevent them from being
320320
// deleted erroneously by the planner (only the TXT registry should do this.)
321321
//
322322
// Per RFC 1034, CNAME records conflict with all other records - it is the

provider/ovh/ovh.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ func planChangesByZoneName(zones []string, changes *plan.Changes) map[string]*pl
195195
return output
196196
}
197197

198-
func (p OVHProvider) computeSingleZoneChanges(_ context.Context, zoneName string, existingRecords []ovhRecord, changes *plan.Changes) ([]ovhChange, error) {
198+
func (p *OVHProvider) computeSingleZoneChanges(_ context.Context, zoneName string, existingRecords []ovhRecord, changes *plan.Changes) ([]ovhChange, error) {
199199
allChanges := []ovhChange{}
200200
var computedChanges []ovhChange
201201

@@ -496,7 +496,7 @@ func ovhGroupByNameAndType(records []ovhRecord) []*endpoint.Endpoint {
496496
return endpoints
497497
}
498498

499-
func (p OVHProvider) newOvhChangeCreateDelete(action int, endpoints []*endpoint.Endpoint, zone string, existingRecords []ovhRecord) ([]ovhChange, []ovhRecord) {
499+
func (p *OVHProvider) newOvhChangeCreateDelete(action int, endpoints []*endpoint.Endpoint, zone string, existingRecords []ovhRecord) ([]ovhChange, []ovhRecord) {
500500
var ovhChanges []ovhChange
501501
var toDeleteIds []int
502502

@@ -564,7 +564,7 @@ func normalizeDNSName(dnsName string) string {
564564
return strings.TrimSpace(strings.ToLower(dnsName))
565565
}
566566

567-
func (p OVHProvider) newOvhChangeUpdate(endpointsOld []*endpoint.Endpoint, endpointsNew []*endpoint.Endpoint, zone string, existingRecords []ovhRecord) ([]ovhChange, error) {
567+
func (p *OVHProvider) newOvhChangeUpdate(endpointsOld []*endpoint.Endpoint, endpointsNew []*endpoint.Endpoint, zone string, existingRecords []ovhRecord) ([]ovhChange, error) {
568568
zoneNameIDMapper := provider.ZoneIDName{}
569569
zoneNameIDMapper.Add(zone, zone)
570570

@@ -709,7 +709,7 @@ func (c *ovhChange) String() string {
709709
return fmt.Sprintf("%s zone action(%s) : %s %d IN %s %s", c.Zone, action, c.SubDomain, c.TTL, c.FieldType, c.Target)
710710
}
711711

712-
func (p OVHProvider) formatCNAMETarget(change *ovhChange) {
712+
func (p *OVHProvider) formatCNAMETarget(change *ovhChange) {
713713
if change.FieldType != endpoint.RecordTypeCNAME {
714714
return
715715
}

provider/transip/transip_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,31 +202,31 @@ func (f *fakeClient) Get(request rest.Request, dest interface{}) error {
202202
return f.getFunc(request, dest)
203203
}
204204

205-
func (f fakeClient) Put(request rest.Request) error {
205+
func (f *fakeClient) Put(request rest.Request) error {
206206
return errors.New("PUT not implemented")
207207
}
208208

209-
func (f fakeClient) Post(request rest.Request) error {
209+
func (f *fakeClient) Post(request rest.Request) error {
210210
return errors.New("POST not implemented")
211211
}
212212

213-
func (f fakeClient) Delete(request rest.Request) error {
213+
func (f *fakeClient) Delete(request rest.Request) error {
214214
return errors.New("DELETE not implemented")
215215
}
216216

217-
func (f fakeClient) Patch(request rest.Request) error {
217+
func (f *fakeClient) Patch(request rest.Request) error {
218218
return errors.New("PATCH not implemented")
219219
}
220220

221-
func (f fakeClient) PatchWithResponse(request rest.Request) (rest.Response, error) {
221+
func (f *fakeClient) PatchWithResponse(request rest.Request) (rest.Response, error) {
222222
return rest.Response{}, errors.New("PATCH with response not implemented")
223223
}
224224

225-
func (f fakeClient) PostWithResponse(request rest.Request) (rest.Response, error) {
225+
func (f *fakeClient) PostWithResponse(request rest.Request) (rest.Response, error) {
226226
return rest.Response{}, errors.New("POST with response not implemented")
227227
}
228228

229-
func (f fakeClient) PutWithResponse(request rest.Request) (rest.Response, error) {
229+
func (f *fakeClient) PutWithResponse(request rest.Request) (rest.Response, error) {
230230
return rest.Response{}, errors.New("PUT with response not implemented")
231231
}
232232

0 commit comments

Comments
 (0)