diff options
Diffstat (limited to 'singleton_ctx.go')
-rw-r--r-- | singleton_ctx.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/singleton_ctx.go b/singleton_ctx.go index 2ba0199..8a0f3cc 100644 --- a/singleton_ctx.go +++ b/singleton_ctx.go @@ -31,6 +31,7 @@ type SingletonContext interface { ModuleErrorf(module Module, format string, args ...interface{}) Errorf(format string, args ...interface{}) + Failed() bool Variable(pctx PackageContext, name, value string) Rule(pctx PackageContext, name string, params RuleParams, argNames ...string) Rule @@ -96,6 +97,10 @@ func (s *singletonContext) Errorf(format string, args ...interface{}) { s.errs = append(s.errs, fmt.Errorf(format, args...)) } +func (s *singletonContext) Failed() bool { + return len(s.errs) > 0 +} + func (s *singletonContext) Variable(pctx PackageContext, name, value string) { s.scope.ReparentTo(pctx) |