From fd7dd47d5e6111eadb0bfc4fb2aec440ebb95e95 Mon Sep 17 00:00:00 2001 From: renovate Date: Tue, 7 Apr 2020 12:30:57 +0000 Subject: [PATCH] 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 --- go.mod | 2 +- go.sum | 2 ++ .../gordonklaus/ineffassign/README.md | 2 +- .../gordonklaus/ineffassign/ineffassign.go | 33 ++++++++++--------- vendor/modules.txt | 2 +- 5 files changed, 22 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index b5f9e77e430..428a1c1b421 100644 --- a/go.mod +++ b/go.mod @@ -41,7 +41,7 @@ require ( github.com/go-xorm/core v0.6.2 // indirect github.com/go-xorm/xorm v0.7.9 // indirect github.com/golang/protobuf v1.3.2 // indirect - github.com/gordonklaus/ineffassign v0.0.0-20180909121442-1003c8bd00dc + github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf github.com/imdario/mergo v0.3.7 github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/jgautheron/goconst v0.0.0-20200227150835-cda7ea3bf591 diff --git a/go.sum b/go.sum index 5dcc1b9e37d..258debf57f0 100644 --- a/go.sum +++ b/go.sum @@ -147,6 +147,8 @@ github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OI github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/gordonklaus/ineffassign v0.0.0-20180909121442-1003c8bd00dc h1:cJlkeAx1QYgO5N80aF5xRGstVsRQwgLR7uA2FnP1ZjY= github.com/gordonklaus/ineffassign v0.0.0-20180909121442-1003c8bd00dc/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= +github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf h1:vc7Dmrk4JwS0ZPS6WZvWlwDflgDTA26jItmbSj83nug= +github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= diff --git a/vendor/github.com/gordonklaus/ineffassign/README.md b/vendor/github.com/gordonklaus/ineffassign/README.md index 6dcb9f0cce1..5d67306958c 100644 --- a/vendor/github.com/gordonklaus/ineffassign/README.md +++ b/vendor/github.com/gordonklaus/ineffassign/README.md @@ -1,4 +1,4 @@ # ineffassign Detect ineffectual assignments in Go code. -This tool misses some cases because does not consider any type information in its analysis. (For example, assignments to struct fields are never marked as ineffectual.) It should, however, never give any false positives. +This tool misses some cases because it does not consider any type information in its analysis. (For example, assignments to struct fields are never marked as ineffectual.) It should, however, never give any false positives. diff --git a/vendor/github.com/gordonklaus/ineffassign/ineffassign.go b/vendor/github.com/gordonklaus/ineffassign/ineffassign.go index d067bc41830..ce4a4f3fdef 100644 --- a/vendor/github.com/gordonklaus/ineffassign/ineffassign.go +++ b/vendor/github.com/gordonklaus/ineffassign/ineffassign.go @@ -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 } diff --git a/vendor/modules.txt b/vendor/modules.txt index 0f35381fe97..d7c342b6979 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -74,7 +74,7 @@ github.com/go-sql-driver/mysql github.com/go-testfixtures/testfixtures/v3 # github.com/golang/protobuf v1.3.2 github.com/golang/protobuf/proto -# github.com/gordonklaus/ineffassign v0.0.0-20180909121442-1003c8bd00dc +# github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf github.com/gordonklaus/ineffassign # github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl