Skip to content

Commit

Permalink
fix: prevent empty contexts to be set in the future
Browse files Browse the repository at this point in the history
  • Loading branch information
zepatrik committed Aug 29, 2023
1 parent 23953e1 commit 546e971
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion text/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

func context(ctx map[string]any) []byte {
if len(ctx) == 0 {
return []byte("{}")
panic("context must not be empty")
}
res, err := json.Marshal(ctx)
if err != nil {
Expand Down

0 comments on commit 546e971

Please sign in to comment.