Add gocritic to golangci-lint config (#9556)

This commit is contained in:
Kris Hicks
2020-12-08 12:47:04 -08:00
committed by GitHub
parent dfcdc9c53d
commit 071f4c7596
17 changed files with 55 additions and 57 deletions

View File

@@ -634,7 +634,8 @@ func (c *OperatorDebugCommand) collectPprof(path, id string, client *api.Client)
return // only exit on 403
}
} else {
if err := c.writeBytes(path, "profile.prof", bs); err != nil {
err := c.writeBytes(path, "profile.prof", bs)
if err != nil {
c.Ui.Error(err.Error())
}
}
@@ -643,7 +644,8 @@ func (c *OperatorDebugCommand) collectPprof(path, id string, client *api.Client)
if err != nil {
c.Ui.Error(fmt.Sprintf("%s: Failed to retrieve pprof trace.prof, err: %v", path, err))
} else {
if err := c.writeBytes(path, "trace.prof", bs); err != nil {
err := c.writeBytes(path, "trace.prof", bs)
if err != nil {
c.Ui.Error(err.Error())
}
}
@@ -652,7 +654,8 @@ func (c *OperatorDebugCommand) collectPprof(path, id string, client *api.Client)
if err != nil {
c.Ui.Error(fmt.Sprintf("%s: Failed to retrieve pprof goroutine.prof, err: %v", path, err))
} else {
if err := c.writeBytes(path, "goroutine.prof", bs); err != nil {
err := c.writeBytes(path, "goroutine.prof", bs)
if err != nil {
c.Ui.Error(err.Error())
}
}
@@ -664,7 +667,8 @@ func (c *OperatorDebugCommand) collectPprof(path, id string, client *api.Client)
if err != nil {
c.Ui.Error(fmt.Sprintf("%s: Failed to retrieve pprof goroutine-debug1.txt, err: %v", path, err))
} else {
if err := c.writeBytes(path, "goroutine-debug1.txt", bs); err != nil {
err := c.writeBytes(path, "goroutine-debug1.txt", bs)
if err != nil {
c.Ui.Error(err.Error())
}
}
@@ -677,7 +681,8 @@ func (c *OperatorDebugCommand) collectPprof(path, id string, client *api.Client)
if err != nil {
c.Ui.Error(fmt.Sprintf("%s: Failed to retrieve pprof goroutine-debug2.txt, err: %v", path, err))
} else {
if err := c.writeBytes(path, "goroutine-debug2.txt", bs); err != nil {
err := c.writeBytes(path, "goroutine-debug2.txt", bs)
if err != nil {
c.Ui.Error(err.Error())
}
}