Skip to content

Commit

Permalink
Not return nil
Browse files Browse the repository at this point in the history
  • Loading branch information
tchssk committed May 16, 2024
1 parent abe4753 commit 78b71ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dsl/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ import (
// })
// })
func Server(name string, fn ...func()) *expr.ServerExpr {
server := &expr.ServerExpr{Name: name}
if len(fn) > 1 {
eval.TooManyArgError()
return nil
return server
}
api, ok := eval.Current().(*expr.APIExpr)
if !ok {
eval.IncompatibleDSL()
}
server := &expr.ServerExpr{Name: name}
if len(fn) > 0 {
eval.Execute(fn[0], server)
}
Expand Down

0 comments on commit 78b71ce

Please sign in to comment.