Update github.com/gordonklaus/ineffassign commit hash to 7953dde (#233)
Update github.com/gordonklaus/ineffassign commit hash to 7953dde Reviewed-on: https://kolaente.dev/vikunja/api/pulls/233
This commit is contained in:
33
vendor/github.com/gordonklaus/ineffassign/ineffassign.go
generated
vendored
33
vendor/github.com/gordonklaus/ineffassign/ineffassign.go
generated
vendored
@ -282,18 +282,17 @@ func (bld *builder) Visit(n ast.Node) ast.Visitor {
|
||||
for _, x := range n.Results {
|
||||
bld.walk(x)
|
||||
}
|
||||
res := bld.results[len(bld.results)-1]
|
||||
if res == nil {
|
||||
break
|
||||
}
|
||||
for _, f := range res.List {
|
||||
for _, id := range f.Names {
|
||||
if n.Results != nil {
|
||||
bld.assign(id)
|
||||
if res := bld.results[len(bld.results)-1]; res != nil {
|
||||
for _, f := range res.List {
|
||||
for _, id := range f.Names {
|
||||
if n.Results != nil {
|
||||
bld.assign(id)
|
||||
}
|
||||
bld.use(id)
|
||||
}
|
||||
bld.use(id)
|
||||
}
|
||||
}
|
||||
bld.newBlock()
|
||||
case *ast.SendStmt:
|
||||
bld.maybePanic()
|
||||
return bld
|
||||
@ -368,14 +367,16 @@ func isZeroInitializer(x ast.Expr) bool {
|
||||
x = c.Args[0]
|
||||
}
|
||||
|
||||
b, ok := x.(*ast.BasicLit)
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
switch b.Value {
|
||||
case "0", "0.0", "0.", ".0", `""`:
|
||||
return true
|
||||
switch x := x.(type) {
|
||||
case *ast.BasicLit:
|
||||
switch x.Value {
|
||||
case "0", "0.0", "0.", ".0", `""`:
|
||||
return true
|
||||
}
|
||||
case *ast.Ident:
|
||||
return x.Name == "false" && x.Obj == nil
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user