Skip to content

Commit

Permalink
return early if no name found for config/secrets/dbs
Browse files Browse the repository at this point in the history
  • Loading branch information
matt2e committed Apr 23, 2024
1 parent 74448c5 commit 5e90252
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions go-runtime/compile/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ func parseConfigDecl(pctx *parseContext, node *ast.CallExpr, fn *types.Func) {
}
if name == "" {
pctx.errors.add(errorf(node, "config and secret declarations must have a single string literal argument"))
return
}
index := node.Fun.(*ast.IndexExpr) //nolint:forcetypeassert

Expand Down Expand Up @@ -273,6 +274,7 @@ func parseDatabaseDecl(pctx *parseContext, node *ast.CallExpr) {
}
if name == "" {
pctx.errors.add(errorf(node, "config and secret declarations must have a single string literal argument"))
return
}
decl := &schema.Database{
Pos: goPosToSchemaPos(node.Pos()),
Expand Down

0 comments on commit 5e90252

Please sign in to comment.