refactor(gofix): modernize

This commit is contained in:
Julien Neuhart
2026-02-20 21:21:19 +01:00
parent aea7c5952a
commit 2baa59cb3a
29 changed files with 131 additions and 149 deletions

View File

@@ -5,11 +5,11 @@ import (
"reflect"
)
func compareJson(expected, actual interface{}) error {
func compareJson(expected, actual any) error {
// Handle maps (JSON objects).
expectedMap, ok := expected.(map[string]interface{})
expectedMap, ok := expected.(map[string]any)
if ok {
actualMap, ok := actual.(map[string]interface{})
actualMap, ok := actual.(map[string]any)
if !ok {
return fmt.Errorf("expected an object, but actual is: %T", actual)
}
@@ -31,9 +31,9 @@ func compareJson(expected, actual interface{}) error {
}
// Handle slices (JSON arrays).
expectedSlice, ok := expected.([]interface{})
expectedSlice, ok := expected.([]any)
if ok {
actualSlice, ok := actual.([]interface{})
actualSlice, ok := actual.([]any)
if !ok {
return fmt.Errorf("expected an array, but actual is: %T", actual)
}