Skip to content
This repository was archived by the owner on Jul 31, 2022. It is now read-only.

Commit 1956076

Browse files
author
Eugene Simonov
committed
Fix issue #22
1 parent b1f55dd commit 1956076

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

pkg/analyzer/analyzer.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ func (nom namedOccurrenceMap) checkExpression(candidate ast.Expr, ifPos token.Po
217217
case *ast.KeyValueExpr:
218218
nom.checkExpression(v.Key, ifPos)
219219
nom.checkExpression(v.Value, ifPos)
220+
case *ast.SelectorExpr:
221+
nom.checkExpression(v.X, ifPos)
220222
}
221223
}
222224
case *ast.FuncLit:

testdata/testdata.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,3 +567,11 @@ func notUsed_UnnerStruct_OK() {
567567
t := []Wrapper{{v}}
568568
noOp1(t)
569569
}
570+
571+
func notUsed_ReturnInSlice_Selector_OK(d dummyType) ([]interface{}, interface{}) {
572+
v := d
573+
if v.interf != nil {
574+
return nil, v.interf
575+
}
576+
return []interface{}{v.interf}, nil
577+
}

0 commit comments

Comments
 (0)