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. --- tools/syz-testbed/html.go | 2 +- tools/syz-testbed/instance.go | 2 +- tools/syz-testbed/stats.go | 2 +- tools/syz-testbed/table.go | 2 +- tools/syz-testbed/testbed.go | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'tools/syz-testbed') diff --git a/tools/syz-testbed/html.go b/tools/syz-testbed/html.go index e8e2e9a22..e02ef0170 100644 --- a/tools/syz-testbed/html.go +++ b/tools/syz-testbed/html.go @@ -291,7 +291,7 @@ func (ctx *TestbedContext) httpMain(w http.ResponseWriter, r *http.Request) { executeTemplate(w, mainTemplate, "testbed.html", data) } -func executeTemplate(w http.ResponseWriter, templ *template.Template, name string, data interface{}) { +func executeTemplate(w http.ResponseWriter, templ *template.Template, name string, data any) { buf := new(bytes.Buffer) if err := templ.ExecuteTemplate(buf, name, data); err != nil { log.Printf("failed to execute template: %v", err) diff --git a/tools/syz-testbed/instance.go b/tools/syz-testbed/instance.go index 5ec278944..476981d7a 100644 --- a/tools/syz-testbed/instance.go +++ b/tools/syz-testbed/instance.go @@ -145,7 +145,7 @@ func SetupSyzkallerInstance(mgrName, folder string, checkout *Checkout) (*Syzkal } log.Printf("[%s] Generating syz-manager config", mgrName) cfgFile := filepath.Join(folder, "manager.cfg") - managerCfg, err := config.PatchJSON(checkout.ManagerConfig, map[string]interface{}{ + managerCfg, err := config.PatchJSON(checkout.ManagerConfig, map[string]any{ "name": mgrName, "workdir": workdir, "syzkaller": checkout.Path, diff --git a/tools/syz-testbed/stats.go b/tools/syz-testbed/stats.go index 4ac02b230..9205ed965 100644 --- a/tools/syz-testbed/stats.go +++ b/tools/syz-testbed/stats.go @@ -19,7 +19,7 @@ type BugInfo struct { Logs []string } -type RunResult interface{} +type RunResult any // The information collected from a syz-manager instance. type SyzManagerResult struct { diff --git a/tools/syz-testbed/table.go b/tools/syz-testbed/table.go index a4bdd98af..ba7ee05d1 100644 --- a/tools/syz-testbed/table.go +++ b/tools/syz-testbed/table.go @@ -13,7 +13,7 @@ import ( "github.com/google/syzkaller/pkg/stat/sample" ) -type Cell = interface{} +type Cell = any // All tables that syz-testbed generates have named columns and rows. // Table type simplifies generation and processing of such tables. diff --git a/tools/syz-testbed/testbed.go b/tools/syz-testbed/testbed.go index 357ff65f6..87d3b4527 100644 --- a/tools/syz-testbed/testbed.go +++ b/tools/syz-testbed/testbed.go @@ -131,7 +131,7 @@ func (ctx *TestbedContext) MakeMgrConfig(base, patch json.RawMessage) json.RawMe tool.Failf("failed to apply a patch to the base manager config: %s", err) } // We don't care much about the specific ports of syz-managers. - mgrCfg, err = config.PatchJSON(mgrCfg, map[string]interface{}{"HTTP": ":0"}) + mgrCfg, err = config.PatchJSON(mgrCfg, map[string]any{"HTTP": ":0"}) if err != nil { tool.Failf("failed to assign empty HTTP value: %s", err) } @@ -266,7 +266,7 @@ func (ctx *TestbedContext) Loop(stop chan struct{}) { } func (d *DurationConfig) UnmarshalJSON(data []byte) error { - var v interface{} + var v any if err := json.Unmarshal(data, &v); err != nil { return err } -- cgit mrf-deployment