File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -70,8 +70,9 @@ func extractSourceFields() ([]SourceField, error) {
7070 break
7171 }
7272
73+ const sourceTypeRef = "Source"
7374 ast .Inspect (node , func (n ast.Node ) bool {
74- if ts , ok := n .(* ast.TypeSpec ); ok && ts .Name .Name == "Source" {
75+ if ts , ok := n .(* ast.TypeSpec ); ok && ts .Name .Name == sourceTypeRef {
7576 found = true
7677 if st , ok := ts .Type .(* ast.StructType ); ok {
7778 for _ , field := range st .Fields .List {
@@ -85,7 +86,7 @@ func extractSourceFields() ([]SourceField, error) {
8586 if ptr , ok := field .Type .(* ast.StarExpr ); ok {
8687 if ident , ok := ptr .X .(* ast.Ident ); ok {
8788 typeName := ident .Name
88- if strings .HasPrefix (typeName , "Source" ) {
89+ if strings .HasPrefix (typeName , sourceTypeRef ) {
8990 sourceFields = append (sourceFields , SourceField {
9091 Name : fieldName ,
9192 TypeName : typeName ,
You can’t perform that action at this time.
0 commit comments