Add the ability to check if a property is present
This adds (to the ModuleContext) a facility to check if a property is defined in a module in a Blueprints file. Change-Id: I16a35fd236717d8797f15093c019f7cc1049fb3c
This commit is contained in:
parent
b6a5039e88
commit
701fbad02b
1 changed files with 6 additions and 0 deletions
|
@ -84,6 +84,7 @@ type DynamicDependerModuleContext interface {
|
|||
ModuleDir() string
|
||||
Config() interface{}
|
||||
|
||||
ContainsProperty(name string) bool
|
||||
Errorf(pos scanner.Position, fmt string, args ...interface{})
|
||||
ModuleErrorf(fmt string, args ...interface{})
|
||||
PropertyErrorf(property, fmt string, args ...interface{})
|
||||
|
@ -119,6 +120,11 @@ func (d *dynamicDependerModuleContext) ModuleName() string {
|
|||
return d.info.properties.Name
|
||||
}
|
||||
|
||||
func (d *dynamicDependerModuleContext) ContainsProperty(name string) bool {
|
||||
_, ok := d.info.propertyPos[name]
|
||||
return ok
|
||||
}
|
||||
|
||||
func (d *dynamicDependerModuleContext) ModuleDir() string {
|
||||
return filepath.Dir(d.info.relBlueprintsFile)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue