Skip to content

Commit 4688fca

Browse files
authored
Create FindShadowSchemaPath (#654)
1 parent f9339e1 commit 4688fca

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ygen/directory.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,15 @@ func FindSchemaPath(parent *Directory, fieldName string, absolutePaths bool) ([]
141141
return schemaPaths, err
142142
}
143143

144+
// FindShadowSchemaPath finds the relative or absolute schema path of a given field
145+
// of a Directory with preference to the shadow path. The Field is specified as a name
146+
// in order to guarantee its existence before processing.
147+
// NOTE: No error is returned if fieldName is not found.
148+
func FindShadowSchemaPath(parent *Directory, fieldName string, absolutePaths bool) ([]string, error) {
149+
schemaPaths, _, err := findSchemaPath(parent, fieldName, true, absolutePaths)
150+
return schemaPaths, err
151+
}
152+
144153
// findSchemaPath finds the relative or absolute schema path of a given field
145154
// of a Directory, or the shadowed field path (i.e. field duplicated and
146155
// deprioritized via compression) of a Directory. The first returned slice

0 commit comments

Comments
 (0)