make lint: enable wastedassign

Because we shouldn't waste assigns.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
Valentin Rothberg 2023-06-19 14:14:48 +02:00
parent 60a5a59475
commit f07aa1bfdc
4 changed files with 2 additions and 4 deletions

View file

@ -21,7 +21,6 @@ linters:
# useful hints that should be addressed
- ginkgolinter
- nakedret
- wastedassign
- gosmopolitan # usage of time.Local in pkg/k8s.io
- tagliatelle # too many JSON keys cannot be changed due to compat
- nosnakecase # too many false positives due to the `unix` package

View file

@ -2463,7 +2463,6 @@ func (c *Container) setHomeEnvIfNeeded() error {
}
// Ensure HOME is not already set in Env
home := ""
for _, s := range c.config.Spec.Process.Env {
if strings.HasPrefix(s, "HOME=") {
return nil

View file

@ -750,7 +750,7 @@ func (c *Container) safeMountSubPath(mountPoint, subpath string) (s *safeMountIn
if err != nil {
return nil, err
}
npath := ""
var npath string
switch {
case fi.Mode()&fs.ModeSymlink != 0:
return nil, fmt.Errorf("file %q is a symlink", joinedPath)

View file

@ -1488,7 +1488,7 @@ func readConmonPipeData(runtimeName string, pipe *os.File, ociLog string) (int,
ch <- syncStruct{si: si}
}()
data := -1
var data int
select {
case ss := <-ch:
if ss.err != nil {