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

@@ -32,7 +32,7 @@ func Parse(reader io.Reader, namespace, rlsName string, local bool) ([]*resource
klog.Infof("parse resources, namespace: %s, release: %s", namespace, rlsName)
start := time.Now()
defer func() {
klog.Infof("parse resources end, namespace: %s, release: %s, cost: %v", namespace, rlsName, time.Now().Sub(start))
klog.Infof("parse resources end, namespace: %s, release: %s, cost: %v", namespace, rlsName, time.Since(start))
}()
}
@@ -41,7 +41,7 @@ func Parse(reader io.Reader, namespace, rlsName string, local bool) ([]*resource
f := cmdutil.NewFactory(matchVersionKubeConfigFlags)
builder := f.NewBuilder().Unstructured().NamespaceParam(namespace).ContinueOnError().Stream(reader, rlsName).Flatten()
if local == true {
if local {
builder = builder.Local()
}
r := builder.Do()
@@ -50,7 +50,7 @@ func Parse(reader io.Reader, namespace, rlsName string, local bool) ([]*resource
return nil, err
}
if local == false {
if !local {
for i := range infos {
infos[i].Namespace = namespace
err := infos[i].Get()