fix: lint issues

- Fix QF1016 in helmexec/exec.go: use fmt.Fprintf instead of Write([]byte(fmt.Sprintf()))
- Remove unused allReleases parameter from collectDirectNeeds

Signed-off-by: yxxhero <aiopsclub@163.com>
(cherry picked from commit 4a6996c014)
Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
yxxhero 2026-03-11 00:28:22 +08:00
parent 28753f9bde
commit b0827faf54
2 changed files with 2 additions and 2 deletions

View File

@ -256,7 +256,7 @@ func (helm *execer) AddRepo(name, repository, cafile, certfile, keyfile, usernam
if username != "" && password != "" {
args = append(args, "--username", username, "--password-stdin")
buffer := bytes.Buffer{}
buffer.Write([]byte(fmt.Sprintf("%s\n", password)))
fmt.Fprintf(&buffer, "%s\n", password)
out, err = helm.execStdIn(args, map[string]string{}, &buffer)
} else {
out, err = helm.exec(args, map[string]string{}, nil)

View File

@ -3056,7 +3056,7 @@ func unmarkDirectNeeds(filteredReleases []Release, allReleases []ReleaseSpec) {
unmarkReleases(directNeeds, filteredReleases)
}
func collectDirectNeeds(filteredReleases []Release, allReleases []ReleaseSpec) map[string]struct{} {
func collectDirectNeeds(filteredReleases []Release, _ []ReleaseSpec) map[string]struct{} {
directNeeds := map[string]struct{}{}
for _, r := range filteredReleases {
if !r.Filtered {