diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2025-12-19 12:52:30 +0100 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2025-12-22 02:13:00 +0000 |
| commit | a83befa0d111a0ba6fac52d763e93c76a2ef94d4 (patch) | |
| tree | 7d3c28b24229429936a631e8ceb24135856b257d /pkg/config/config.go | |
| parent | 8fb7048c5117ccb592deb5e8e4a62027e6d399cf (diff) | |
all: use any instead of interface{}
Any is the preferred over interface{} now in Go.
Diffstat (limited to 'pkg/config/config.go')
| -rw-r--r-- | pkg/config/config.go | 6 |
1 files changed, 3 insertions, 3 deletions
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 |
