From abd11cfd08430ec5f9d2c6dbd0e0f798816922d1 Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Tue, 15 Jul 2025 16:43:33 +0200 Subject: all: apply linter auto fixes ./tools/syz-env bin/golangci-lint run ./... --fix --- syz-ci/jobs.go | 6 +++--- syz-ci/jobs_test.go | 2 +- syz-ci/manager.go | 2 +- syz-ci/syz-ci.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'syz-ci') diff --git a/syz-ci/jobs.go b/syz-ci/jobs.go index a9bb23abc..ee2e861b3 100644 --- a/syz-ci/jobs.go +++ b/syz-ci/jobs.go @@ -461,7 +461,7 @@ func (jp *JobProcessor) bisect(job *Job, mgrcfg *mgrconfig.Config) error { cfg := &bisect.Config{ Trace: &debugtracer.GenericTracer{ TraceWriter: io.MultiWriter(trace, log.VerboseWriter(3)), - OutDir: osutil.Abs(filepath.Join("jobs", "debug", strings.Replace(req.ID, "|", "_", -1))), + OutDir: osutil.Abs(filepath.Join("jobs", "debug", strings.ReplaceAll(req.ID, "|", "_"))), }, // Out of 1049 cause bisections that we have now: // - 891 finished under 6h (84.9%) @@ -641,9 +641,9 @@ func (jp *JobProcessor) testPatch(job *Job, mgrcfg *mgrconfig.Config) error { // Testing of patches for these bugs fail now because of the config, so we disable it as a work-around. // Ideally we have a new pahole and then we can remove this hack. That's issue #2096. // pkg/vcs/linux.go also disables it for the bisection process. - req.KernelConfig = bytes.Replace(req.KernelConfig, + req.KernelConfig = bytes.ReplaceAll(req.KernelConfig, []byte("CONFIG_DEBUG_INFO_BTF=y"), - []byte("# CONFIG_DEBUG_INFO_BTF is not set"), -1) + []byte("# CONFIG_DEBUG_INFO_BTF is not set")) log.Logf(0, "job: building kernel...") kernelConfig, details, err := env.BuildKernel(buildCfg) diff --git a/syz-ci/jobs_test.go b/syz-ci/jobs_test.go index 1ad7b7efc..547fd96e2 100644 --- a/syz-ci/jobs_test.go +++ b/syz-ci/jobs_test.go @@ -125,7 +125,7 @@ func TestAggregateTestResults(t *testing.T) { if rep != nil { gotOutput = rep.rawOutput } - if fmt.Sprint(test.rawOut) != fmt.Sprint(gotOutput) { + if fmt.Sprint(string(test.rawOut)) != fmt.Sprint(string(gotOutput)) { t.Errorf("test #%v: got raw out: %q, want: %q", i, gotOutput, test.rawOut) } } diff --git a/syz-ci/manager.go b/syz-ci/manager.go index f21933118..ab1e0820b 100644 --- a/syz-ci/manager.go +++ b/syz-ci/manager.go @@ -1074,7 +1074,7 @@ func uploadFileHTTPPut(ctx context.Context, URL string, file io.Reader) error { return fmt.Errorf("failed to perform HTTP PUT request: %w", err) } defer resp.Body.Close() - if !(resp.StatusCode >= 200 && resp.StatusCode <= 299) { + if resp.StatusCode < 200 || resp.StatusCode > 299 { return fmt.Errorf("HTTP PUT failed with status code: %v", resp.StatusCode) } return nil diff --git a/syz-ci/syz-ci.go b/syz-ci/syz-ci.go index 3cefab1bc..7df27b683 100644 --- a/syz-ci/syz-ci.go +++ b/syz-ci/syz-ci.go @@ -317,10 +317,10 @@ func main() { http.HandleFunc("/upload_cover", func(w http.ResponseWriter, r *http.Request) { for _, mgr := range managers { if err := mgr.uploadCoverReport(ctx); err != nil { - w.Write([]byte(fmt.Sprintf("failed for %v: %v
\n", mgr.name, err))) + fmt.Fprintf(w, "failed for %v: %v
\n", mgr.name, err) return } - w.Write([]byte(fmt.Sprintf("upload cover for %v
\n", mgr.name))) + fmt.Fprintf(w, "upload cover for %v
\n", mgr.name) } }) -- cgit mrf-deployment