Skip to content

Commit

Permalink
ci: enable gocritic in golangci (#1223)
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalBourdier authored Dec 17, 2024
1 parent 96598cc commit 7482867
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
linters:
enable:
- gocritic
3 changes: 1 addition & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,7 @@ func (c colimaApp) Version() error {

var kube environment.Container
for _, cont := range containerRuntimes {
switch cont.Name() {
case kubernetes.Name:
if cont.Name() == kubernetes.Name {
kube = cont
continue
}
Expand Down
6 changes: 3 additions & 3 deletions environment/container/docker/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ func (d dockerRuntime) createDaemonFile(conf map[string]any, env map[string]stri
return err
}
if vars.http != "" {
proxyConf["http-proxy"] = strings.Replace(vars.http, "127.0.0.1", hostGatewayIP, -1)
proxyConf["http-proxy"] = strings.ReplaceAll(vars.http, "127.0.0.1", hostGatewayIP)
}
if vars.https != "" {
proxyConf["https-proxy"] = strings.Replace(vars.https, "127.0.0.1", hostGatewayIP, -1)
proxyConf["https-proxy"] = strings.ReplaceAll(vars.https, "127.0.0.1", hostGatewayIP)
}
if vars.no != "" {
proxyConf["no-proxy"] = strings.Replace(vars.no, "127.0.0.1", hostGatewayIP, -1)
proxyConf["no-proxy"] = strings.ReplaceAll(vars.no, "127.0.0.1", hostGatewayIP)
}
conf["proxies"] = proxyConf
}
Expand Down
4 changes: 1 addition & 3 deletions environment/container/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,7 @@ func (c kubernetesRuntime) Teardown(ctx context.Context) error {

// k3s is buggy with external containerd for now
// cleanup is manual
a.Add(func() error {
return c.deleteAllContainers()
})
a.Add(c.deleteAllContainers)

c.teardownKubeconfig(a)

Expand Down
2 changes: 1 addition & 1 deletion util/terminal/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (v *verboseWriter) refresh() error {
}

func (v *verboseWriter) addLine() {
defer v.buf.Truncate(0)
defer v.buf.Reset()

// if height <=0, do not scroll
if v.lineHeight <= 0 {
Expand Down

0 comments on commit 7482867

Please sign in to comment.