Skip to content

Commit 3cab795

Browse files
committed
chore: use any instead of interface{}
1 parent a3a8e51 commit 3cab795

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

internal/controller/dnsrecord_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,14 +278,14 @@ func comparePriority(a, b *uint16) bool {
278278
}
279279

280280
// compareData compares the data nil safe
281-
func compareData(a interface{}, b *apiextensionsv1.JSON) bool {
281+
func compareData(a any, b *apiextensionsv1.JSON) bool {
282282
if a == nil && b == nil {
283283
return true
284284
}
285285
if a == nil || b == nil {
286286
return false
287287
}
288-
var bb interface{}
288+
var bb any
289289
if err := json.Unmarshal(b.Raw, &bb); err != nil {
290290
return false
291291
}

internal/controller/dnsrecord_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func TestDNSRecordReconciler_reconcileDNSRecord(t *testing.T) {
181181
Content: dnsRecordSpec.Content,
182182
Proxied: dnsRecordSpec.Proxied,
183183
Priority: dnsRecordSpec.Priority,
184-
Data: map[string]interface{}{"key": "value"},
184+
Data: map[string]any{"key": "value"},
185185
}
186186

187187
isEqual := r.compareDNSRecord(dnsRecordSpec, cfDnsRecord)

internal/controller/ip_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ func (r *IPReconciler) getIPSource(ctx context.Context, source cloudflareoperato
237237

238238
extractedIP := string(response)
239239
if source.ResponseJQFilter != "" {
240-
var jsonResponse interface{}
240+
var jsonResponse any
241241
if err := json.Unmarshal(response, &jsonResponse); err != nil {
242242
return "", fmt.Errorf("failed to get IP from %s: %s", source.URL, err)
243243
}

0 commit comments

Comments
 (0)