Skip to content

Commit

Permalink
Discard exported method declaration when running ginkgo bootstrap (#558)
Browse files Browse the repository at this point in the history
Previously, ginkgo bootstrap -nodot will make compile error because
it export function including method. Fix it by ignore FuncDecl if
Recv is not nil.

Fixes #557
  • Loading branch information
wingyplus committed Aug 6, 2020
1 parent 1bed1cb commit f4b0240
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ginkgo/nodot/nodot.go
Expand Up @@ -186,7 +186,9 @@ func getExportedDeclarationsForFile(path string) ([]string, error) {
declarations = append(declarations, s.Names[0].Name)
}
case *ast.FuncDecl:
declarations = append(declarations, x.Name.Name)
if x.Recv == nil {
declarations = append(declarations, x.Name.Name)
}
}
}

Expand Down

0 comments on commit f4b0240

Please sign in to comment.