aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mgechev/revive/rule/string-format.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/mgechev/revive/rule/string-format.go')
-rw-r--r--vendor/github.com/mgechev/revive/rule/string-format.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/vendor/github.com/mgechev/revive/rule/string-format.go b/vendor/github.com/mgechev/revive/rule/string-format.go
index 0e30ebf8b..3edd62477 100644
--- a/vendor/github.com/mgechev/revive/rule/string-format.go
+++ b/vendor/github.com/mgechev/revive/rule/string-format.go
@@ -211,10 +211,14 @@ func (lintStringFormatRule) getCallName(call *ast.CallExpr) (callName string, ok
if selector, ok := call.Fun.(*ast.SelectorExpr); ok {
// Scoped function call
scope, ok := selector.X.(*ast.Ident)
- if !ok {
- return "", false
+ if ok {
+ return scope.Name + "." + selector.Sel.Name, true
+ }
+ // Scoped function call inside structure
+ recv, ok := selector.X.(*ast.SelectorExpr)
+ if ok {
+ return recv.Sel.Name + "." + selector.Sel.Name, true
}
- return scope.Name + "." + selector.Sel.Name, true
}
return "", false