Skip to content

Commit

Permalink
fix #781 (#782)
Browse files Browse the repository at this point in the history
  • Loading branch information
chavacava authored Jan 26, 2023
1 parent 54ee9db commit a4f4632
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rule/nested-structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ type lintNestedStructs struct {

func (l *lintNestedStructs) Visit(n ast.Node) ast.Visitor {
switch v := n.(type) {
case *ast.TypeSpec:
_, isInterface := v.Type.(*ast.InterfaceType)
if isInterface {
return nil // do not analyze interface declarations
}
case *ast.FuncDecl:
if v.Body != nil {
ast.Walk(l, v.Body)
Expand Down
5 changes: 5 additions & 0 deletions testdata/nested-structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,8 @@ type Bad struct {
type issue744 struct {
c chan struct{}
}

// issue 781
type mySetInterface interface {
GetSet() map[string]struct{}
}

0 comments on commit a4f4632

Please sign in to comment.