Skip to content

Commit a4f4632

Browse files
authored
fix #781 (#782)
1 parent 54ee9db commit a4f4632

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

rule/nested-structs.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ type lintNestedStructs struct {
3737

3838
func (l *lintNestedStructs) Visit(n ast.Node) ast.Visitor {
3939
switch v := n.(type) {
40+
case *ast.TypeSpec:
41+
_, isInterface := v.Type.(*ast.InterfaceType)
42+
if isInterface {
43+
return nil // do not analyze interface declarations
44+
}
4045
case *ast.FuncDecl:
4146
if v.Body != nil {
4247
ast.Walk(l, v.Body)

testdata/nested-structs.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,8 @@ type Bad struct {
4040
type issue744 struct {
4141
c chan struct{}
4242
}
43+
44+
// issue 781
45+
type mySetInterface interface {
46+
GetSet() map[string]struct{}
47+
}

0 commit comments

Comments
 (0)