aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mgechev/revive/rule/string-format.go
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2023-12-05 15:10:03 +0100
committerTaras Madan <tarasmadan@google.com>2023-12-06 11:31:44 +0000
commit2ab72b4feef2c97f22f90cfbf9e45a6cfcd08bda (patch)
treea6d19b94b6399fcc00a6cfa430885cd349dd1533 /vendor/github.com/mgechev/revive/rule/string-format.go
parente08e8f492d31d672cc245944c185f8aadf2ee695 (diff)
vendor: updates
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