Skip to content

Commit 960a903

Browse files
fix goalngci-lint QF1012
1 parent 99a604c commit 960a903

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

internal/pkg/datasources/datasource_conda.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ func renderPipConfig(pipIndexURL string, pipExtraIndexURLs []string) (string, er
373373
return "", err
374374
}
375375

376-
sb.WriteString(fmt.Sprintf("index-url = %s\n", pipIndexURL))
376+
fmt.Fprintf(&sb, "index-url = %s\n", pipIndexURL)
377377
trustedHosts = append(trustedHosts, parsedPipIndexURL.Host)
378378
}
379379
if len(pipExtraIndexURLs) > 0 {
@@ -383,7 +383,7 @@ func renderPipConfig(pipIndexURL string, pipExtraIndexURLs []string) (string, er
383383
return "", err
384384
}
385385

386-
sb.WriteString(fmt.Sprintf("extra-index-url = %s\n", pipExtraIndexURLs[0]))
386+
fmt.Fprintf(&sb, "extra-index-url = %s\n", pipExtraIndexURLs[0])
387387
trustedHosts = append(trustedHosts, parsedExtraIndexURL.Host)
388388
} else {
389389
extraIndexURLs := make([]string, 0, len(pipExtraIndexURLs))
@@ -397,7 +397,11 @@ func renderPipConfig(pipIndexURL string, pipExtraIndexURLs []string) (string, er
397397
trustedHosts = append(trustedHosts, parsedExtraIndexURL.Host)
398398
}
399399

400-
sb.WriteString(fmt.Sprintf("extra-index-url =\n %s\n", strings.Join(extraIndexURLs, "\n ")))
400+
fmt.Fprintf(
401+
&sb,
402+
"extra-index-url =\n %s\n",
403+
strings.Join(extraIndexURLs, "\n "),
404+
)
401405
}
402406
}
403407
if len(trustedHosts) > 0 {

0 commit comments

Comments
 (0)