@@ -207,7 +207,9 @@ func TestCreateSession(t *testing.T) {
207207
208208 bodyBytes , _ := json .Marshal (body )
209209 var bodyMap map [string ]interface {}
210- json .Unmarshal (bodyBytes , & bodyMap )
210+ if err := json .Unmarshal (bodyBytes , & bodyMap ); err != nil {
211+ t .Fatalf ("Failed to unmarshal request body: %v" , err )
212+ }
211213
212214 if tt .title != "" {
213215 if _ , ok := bodyMap ["title" ]; ! ok {
@@ -340,7 +342,9 @@ func TestSendMessage(t *testing.T) {
340342 if _ , err := os .Stat (filePath ); os .IsNotExist (err ) {
341343 tmpFile , err := os .CreateTemp ("" , "test-*.txt" )
342344 if err == nil {
343- tmpFile .WriteString ("test content" )
345+ if _ , err := tmpFile .WriteString ("test content" ); err != nil {
346+ t .Fatalf ("Failed to write to temp file: %v" , err )
347+ }
344348 tmpFile .Close ()
345349 tempFiles = append (tempFiles , tmpFile .Name ())
346350 }
@@ -357,7 +361,9 @@ func TestSendMessage(t *testing.T) {
357361
358362 bodyBytes , _ := json .Marshal (body )
359363 var bodyMap map [string ]interface {}
360- json .Unmarshal (bodyBytes , & bodyMap )
364+ if err := json .Unmarshal (bodyBytes , & bodyMap ); err != nil {
365+ t .Fatalf ("Failed to unmarshal request body: %v" , err )
366+ }
361367
362368 if _ , ok := bodyMap ["parts" ]; ! ok {
363369 t .Error ("Expected 'parts' in request body" )
0 commit comments