chore: style fixes from go fix (#10846)
Just `go fix ./...` Signed-off-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
@@ -1158,8 +1158,8 @@ func TestInvalidDeviceIDRejected(t *testing.T) {
|
||||
|
||||
// Change the device ID of the first device to "invalid". Fast and loose
|
||||
// with the type assertions as we know what the JSON decoder returns.
|
||||
devs := cfg["devices"].([]interface{})
|
||||
dev0 := devs[0].(map[string]interface{})
|
||||
devs := cfg["devices"].([]any)
|
||||
dev0 := devs[0].(map[string]any)
|
||||
dev0["deviceID"] = tc.id
|
||||
devs[0] = dev0
|
||||
|
||||
@@ -1197,8 +1197,8 @@ func TestInvalidFolderIDRejected(t *testing.T) {
|
||||
// Change the folder ID of the first folder to the empty string.
|
||||
// Fast and loose with the type assertions as we know what the JSON
|
||||
// decoder returns.
|
||||
devs := cfg["folders"].([]interface{})
|
||||
dev0 := devs[0].(map[string]interface{})
|
||||
devs := cfg["folders"].([]any)
|
||||
dev0 := devs[0].(map[string]any)
|
||||
dev0["id"] = tc.id
|
||||
devs[0] = dev0
|
||||
|
||||
@@ -1324,7 +1324,7 @@ func adjustFolderConfiguration(cfg *FolderConfiguration, id, label string, fsTyp
|
||||
// defaultConfigAsMap returns a valid default config as a JSON-decoded
|
||||
// map[string]interface{}. This is useful to override random elements and
|
||||
// re-encode into JSON.
|
||||
func defaultConfigAsMap() map[string]interface{} {
|
||||
func defaultConfigAsMap() map[string]any {
|
||||
cfg := New(device1)
|
||||
dev := cfg.Defaults.Device.Copy()
|
||||
adjustDeviceConfiguration(&dev, device2, "name")
|
||||
@@ -1337,7 +1337,7 @@ func defaultConfigAsMap() map[string]interface{} {
|
||||
// can't happen
|
||||
panic(err)
|
||||
}
|
||||
var tmp map[string]interface{}
|
||||
var tmp map[string]any
|
||||
if err := json.Unmarshal(bs, &tmp); err != nil {
|
||||
// can't happen
|
||||
panic(err)
|
||||
|
||||
Reference in New Issue
Block a user