File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ type SetFilter struct {
21
21
}
22
22
23
23
func (f SetFilter ) Filter (node ast.Node ) bool {
24
- nodeName , exists := getName (node )
24
+ nodeName , exists := GetName (node )
25
25
if ! exists {
26
26
return false
27
27
}
@@ -46,7 +46,7 @@ type RegexpFilter struct {
46
46
}
47
47
48
48
func (s RegexpFilter ) Filter (node ast.Node ) bool {
49
- nodeName , exists := getName (node )
49
+ nodeName , exists := GetName (node )
50
50
if ! exists {
51
51
return false
52
52
}
@@ -122,9 +122,9 @@ func (v visitFunc) Visit(node ast.Node) ast.Visitor {
122
122
}
123
123
}
124
124
125
- // getName gets the name of a node's identifier. For TypeSpecs and FuncDecls, it looks at the .Name field. For
125
+ // GetName gets the name of a node's identifier. For TypeSpecs and FuncDecls, it looks at the .Name field. For
126
126
// SelectorExpr's, it looks at the Sel field.
127
- func getName (n ast.Node ) (name string , exists bool ) {
127
+ func GetName (n ast.Node ) (name string , exists bool ) {
128
128
var ident_ interface {}
129
129
if idt , exists := getStructField (n , "Name" ); exists {
130
130
ident_ = idt
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ func TestNestedFilters(t *testing.T) {
84
84
t .Fatalf ("expected to get 1 AST node back, but got %d: %v" , len (service_ ), service_ )
85
85
}
86
86
service := service_ [0 ]
87
- serviceName , _ := getName (service )
87
+ serviceName , _ := GetName (service )
88
88
89
89
expMethods := make ([]nodeInfo , len (test .methods ))
90
90
for i , m := range test .methods {
@@ -117,7 +117,7 @@ func TestNestedFilters(t *testing.T) {
117
117
118
118
func nodeInfoFromNode (node ast.Node ) nodeInfo {
119
119
var info nodeInfo
120
- if name , nameExists := getName (node ); nameExists {
120
+ if name , nameExists := GetName (node ); nameExists {
121
121
info .Name = name
122
122
}
123
123
info .Type = reflect .TypeOf (node )
You can’t perform that action at this time.
0 commit comments