From c967487ce67cb315fd67c021187a0645ebd1be6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Gill=C3=A9?= Date: Sat, 23 Mar 2024 11:12:14 +0100 Subject: [PATCH] Add missing error check in minimal example --- examples/minimal/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/minimal/main.go b/examples/minimal/main.go index 6c0efbf..fde1f9e 100644 --- a/examples/minimal/main.go +++ b/examples/minimal/main.go @@ -18,7 +18,7 @@ func main() { panic(err) } - c.AddDocuments(ctx, []chromem.Document{ + err = c.AddDocuments(ctx, []chromem.Document{ { ID: "1", Content: "The sky is blue because of Rayleigh scattering.", @@ -28,6 +28,9 @@ func main() { Content: "Leaves are green because chlorophyll absorbs red and blue light.", }, }, runtime.NumCPU()) + if err != nil { + panic(err) + } res, err := c.Query(ctx, "Why is the sky blue?", 1, nil, nil) if err != nil {