Skip to content

Commit

Permalink
Fix misc issues
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael committed Jun 29, 2024
1 parent 2204caf commit 09c6f28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion model/expr/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ type (

// Register design root with eval engine.
func init() {
InitRoot()
if err := eval.Register(Root); err != nil {
panic(err)
}
InitRoot()
}

// InitRoot initializes the root expression.
Expand Down
9 changes: 4 additions & 5 deletions model/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ func Validate(_ string, roots []eval.Root, files []*codegen.File) ([]*codegen.Fi
var r *modelexpr.RootExpr
var ok bool
for _, root := range roots {
if r, ok := root.(*expr.RootExpr); ok {
if re, ok := root.(*expr.RootExpr); ok {
// Note: this root is guaranteed to be appear before the model root
services = r.Services
services = re.Services
continue
}
r, ok = root.(*modelexpr.RootExpr)
if ok {
if r, ok = root.(*modelexpr.RootExpr); ok {
break
}
}
Expand Down Expand Up @@ -152,7 +151,7 @@ func Validate(_ string, roots []eval.Root, files []*codegen.File) ([]*codegen.Fi
pluralize(len(noService)), strings.Join(noService, ", "), pluralVerb(len(noService)))
}

return nil, nil
return files, nil
}

// Helper functions to handle singular/plural
Expand Down

0 comments on commit 09c6f28

Please sign in to comment.