Add golangci-lint workflow (#4999)

* fix lint workflow

* add golang lint

* close http response body
This commit is contained in:
andrew_li
2022-06-29 11:58:36 +08:00
committed by GitHub
parent f1e06466df
commit f289795312
141 changed files with 311 additions and 592 deletions

View File

@@ -20,10 +20,6 @@ package reposcache
import (
"context"
"errors"
"fmt"
"io/ioutil"
"os"
"path"
"strings"
"sync"
@@ -130,20 +126,6 @@ func (c *cachedRepos) deleteRepo(repo *v1alpha1.HelmRepo) {
}
}
func loadBuiltinChartData(name, version string) ([]byte, error) {
fName := path.Join(WorkDir, "chart", fmt.Sprintf("%s-%s.tgz", name, version))
f, err := os.Open(fName)
if err != nil {
return nil, err
}
data, err := ioutil.ReadAll(f)
if err != nil {
klog.Errorf("read index failed, error: %s", err)
return nil, err
}
return data, nil
}
func (c *cachedRepos) DeleteRepo(repo *v1alpha1.HelmRepo) error {
c.Lock()
defer c.Unlock()