From c7f67487615753d86ffb6fbdd62c709afb501ddd Mon Sep 17 00:00:00 2001 From: renovate Date: Tue, 7 Apr 2020 08:38:00 +0000 Subject: [PATCH] Update github.com/jgautheron/goconst commit hash to cda7ea3 (#228) Update github.com/jgautheron/goconst commit hash to cda7ea3 Reviewed-on: https://kolaente.dev/vikunja/api/pulls/228 --- go.mod | 2 +- go.sum | 2 ++ vendor/github.com/jgautheron/goconst/go.mod | 3 +++ vendor/github.com/jgautheron/goconst/visitor.go | 12 +++++++++++- vendor/modules.txt | 2 +- 5 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 vendor/github.com/jgautheron/goconst/go.mod diff --git a/go.mod b/go.mod index 002d9dccc78..f2a873585f2 100644 --- a/go.mod +++ b/go.mod @@ -44,7 +44,7 @@ require ( github.com/gordonklaus/ineffassign v0.0.0-20180909121442-1003c8bd00dc github.com/imdario/mergo v0.3.7 github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/jgautheron/goconst v0.0.0-20170703170152-9740945f5dcb + github.com/jgautheron/goconst v0.0.0-20200227150835-cda7ea3bf591 github.com/labstack/echo/v4 v4.1.14 github.com/labstack/gommon v0.3.0 github.com/laurent22/ical-go v0.1.1-0.20181107184520-7e5d6ade8eef diff --git a/go.sum b/go.sum index 5b4050cdbbe..986b9fa7047 100644 --- a/go.sum +++ b/go.sum @@ -163,6 +163,8 @@ github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80s github.com/jackc/pgx v3.6.0+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= github.com/jgautheron/goconst v0.0.0-20170703170152-9740945f5dcb h1:D5s1HIu80AcMGcqmk7fNIVptmAubVHHaj3v5Upex6Zs= github.com/jgautheron/goconst v0.0.0-20170703170152-9740945f5dcb/go.mod h1:82TxjOpWQiPmywlbIaB2ZkqJoSYJdLGPgAJDvM3PbKc= +github.com/jgautheron/goconst v0.0.0-20200227150835-cda7ea3bf591 h1:x/BpEhm6aL26o4TLtcU0loJ7B3+69jielrGc70V7Yb4= +github.com/jgautheron/goconst v0.0.0-20200227150835-cda7ea3bf591/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/json-iterator/go v0.0.0-20180806060727-1624edc4454b/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= diff --git a/vendor/github.com/jgautheron/goconst/go.mod b/vendor/github.com/jgautheron/goconst/go.mod new file mode 100644 index 00000000000..53dbfbbb99e --- /dev/null +++ b/vendor/github.com/jgautheron/goconst/go.mod @@ -0,0 +1,3 @@ +module github.com/jgautheron/goconst + +go 1.13 diff --git a/vendor/github.com/jgautheron/goconst/visitor.go b/vendor/github.com/jgautheron/goconst/visitor.go index a86421f6d69..27cd5d8a21f 100644 --- a/vendor/github.com/jgautheron/goconst/visitor.go +++ b/vendor/github.com/jgautheron/goconst/visitor.go @@ -95,6 +95,15 @@ func (v *treeVisitor) Visit(node ast.Node) ast.Visitor { v.addString(lit.Value, lit.Pos()) } } + + // fn("http://") + case *ast.CallExpr: + for _, item := range t.Args { + lit, ok := item.(*ast.BasicLit) + if ok && v.isSupported(lit.Kind) { + v.addString(lit.Value, lit.Pos()) + } + } } return v @@ -102,7 +111,8 @@ func (v *treeVisitor) Visit(node ast.Node) ast.Visitor { // addString adds a string in the map along with its position in the tree. func (v *treeVisitor) addString(str string, pos token.Pos) { - str = strings.Replace(str, `"`, "", 2) + // Drop first and last character, quote, backquote... + str = str[1 : len(str)-1] // Ignore empty strings if len(str) == 0 { diff --git a/vendor/modules.txt b/vendor/modules.txt index 9627ec1daa8..f03bf25d906 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -91,7 +91,7 @@ github.com/hashicorp/hcl/json/token github.com/imdario/mergo # github.com/inconshreveable/mousetrap v1.0.0 github.com/inconshreveable/mousetrap -# github.com/jgautheron/goconst v0.0.0-20170703170152-9740945f5dcb +# github.com/jgautheron/goconst v0.0.0-20200227150835-cda7ea3bf591 github.com/jgautheron/goconst github.com/jgautheron/goconst/cmd/goconst # github.com/labstack/echo/v4 v4.1.14