chore: cosmetic & fix.

This commit is contained in:
Alexandre Pujol 2024-05-25 22:21:59 +01:00
parent 72107dcfff
commit 54fdf38861
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
3 changed files with 32 additions and 14 deletions

View file

@ -62,6 +62,17 @@ func (r Rules) GetVariables() []*Variable {
return res
}
func (r Rules) GetIncludes() []*Include {
res := make([]*Include, 0)
for _, rule := range r {
switch rule.(type) {
case *Include:
res = append(res, rule.(*Include))
}
}
return res
}
// Must is a helper that wraps a call to a function returning (any, error) and
// panics if the error is non-nil.
func Must[T any](v T, err error) T {