From 5355e5877039fc0ca050f434f106d70747ddbbf9 Mon Sep 17 00:00:00 2001 From: Jacob Zimmerman Date: Wed, 16 Oct 2024 09:10:50 -0400 Subject: [PATCH] fix: lint --- examples/beta/vectorstorefilebatch/main.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/examples/beta/vectorstorefilebatch/main.go b/examples/beta/vectorstorefilebatch/main.go index a90cf34..7d07476 100644 --- a/examples/beta/vectorstorefilebatch/main.go +++ b/examples/beta/vectorstorefilebatch/main.go @@ -22,17 +22,13 @@ func main() { rdr, err := os.Open(arg) defer rdr.Close() if err != nil { - panic(err.Error()) + panic("file open failed:" + err.Error()) } fileParams = append(fileParams, openai.FileNewParams{ File: openai.F[io.Reader](rdr), Purpose: openai.F(openai.FilePurposeAssistants), }) - - if err != nil { - panic(err.Error()) - } } println("Creating a new vector store and uploading files") @@ -52,7 +48,7 @@ func main() { ) if err != nil { - panic(err.Error()) + panic(err) } // 0 uses default polling interval @@ -60,7 +56,7 @@ func main() { []string{}, 0) if err != nil { - panic(err.Error()) + panic(err) } println("Listing the files from the vector store") @@ -69,7 +65,7 @@ func main() { openai.BetaVectorStoreFileBatchListFilesParams{}) if err != nil { - panic(err.Error()) + panic(err) } for filesCursor != nil { @@ -78,7 +74,7 @@ func main() { } filesCursor, err = filesCursor.GetNextPage() if err != nil { - panic(err.Error()) + panic(err) } } }