1
0

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
This commit is contained in:
renovate
2020-04-07 08:38:00 +00:00
committed by konrad
parent 7efa0069cb
commit c7f6748761
5 changed files with 18 additions and 3 deletions

View File

@ -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 {