From a83befa0d111a0ba6fac52d763e93c76a2ef94d4 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 19 Dec 2025 12:52:30 +0100 Subject: all: use any instead of interface{} Any is the preferred over interface{} now in Go. --- pkg/config/config.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pkg/config/config.go') diff --git a/pkg/config/config.go b/pkg/config/config.go index 5af99ba0f..0a0346f83 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -13,7 +13,7 @@ import ( "github.com/google/syzkaller/pkg/osutil" ) -func LoadFile(filename string, cfg interface{}) error { +func LoadFile(filename string, cfg any) error { if filename == "" { return fmt.Errorf("no config file specified") } @@ -24,7 +24,7 @@ func LoadFile(filename string, cfg interface{}) error { return LoadData(data, cfg) } -func LoadData(data []byte, cfg interface{}) error { +func LoadData(data []byte, cfg any) error { // Remove comment lines starting with #. data = regexp.MustCompile(`(^|\n)\s*#[^\n]*`).ReplaceAll(data, nil) dec := json.NewDecoder(bytes.NewReader(data)) @@ -35,7 +35,7 @@ func LoadData(data []byte, cfg interface{}) error { return nil } -func SaveFile(filename string, cfg interface{}) error { +func SaveFile(filename string, cfg any) error { data, err := json.MarshalIndent(cfg, "", "\t") if err != nil { return err -- cgit mrf-deployment