Skip to content

Commit e60b360

Browse files
committed
chore: run modernize
1 parent 4dcbd58 commit e60b360

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

providers/openai/openai_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2407,11 +2407,11 @@ func TestDoStream(t *testing.T) {
24072407
require.NotEqual(t, -1, toolCall)
24082408

24092409
// Verify tool deltas combine to form the complete input
2410-
fullInput := ""
2410+
var fullInput strings.Builder
24112411
for _, delta := range toolDeltas {
2412-
fullInput += delta
2412+
fullInput.WriteString(delta)
24132413
}
2414-
require.Equal(t, `{"value":"Sparkle Day"}`, fullInput)
2414+
require.Equal(t, `{"value":"Sparkle Day"}`, fullInput.String())
24152415
})
24162416

24172417
t.Run("should stream annotations/citations", func(t *testing.T) {

schema/schema_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func TestEnumSupport(t *testing.T) {
1515
Format string `json:"format,omitempty" enum:"json,xml,text"`
1616
}
1717

18-
schema := Generate(reflect.TypeOf(WeatherInput{}))
18+
schema := Generate(reflect.TypeFor[WeatherInput]())
1919

2020
require.Equal(t, "object", schema.Type)
2121

@@ -300,7 +300,7 @@ func TestGenerateSchemaPointerTypes(t *testing.T) {
300300
Age *int `json:"age"`
301301
}
302302

303-
schema := Generate(reflect.TypeOf(StructWithPointers{}))
303+
schema := Generate(reflect.TypeFor[StructWithPointers]())
304304

305305
require.Equal(t, "object", schema.Type)
306306

@@ -324,7 +324,7 @@ func TestGenerateSchemaNestedStructs(t *testing.T) {
324324
Address Address `json:"address"`
325325
}
326326

327-
schema := Generate(reflect.TypeOf(Person{}))
327+
schema := Generate(reflect.TypeFor[Person]())
328328

329329
require.Equal(t, "object", schema.Type)
330330

@@ -345,7 +345,7 @@ func TestGenerateSchemaRecursiveStructs(t *testing.T) {
345345
Next *Node `json:"next,omitempty"`
346346
}
347347

348-
schema := Generate(reflect.TypeOf(Node{}))
348+
schema := Generate(reflect.TypeFor[Node]())
349349

350350
require.Equal(t, "object", schema.Type)
351351

@@ -367,7 +367,7 @@ func TestGenerateSchemaWithEnumTags(t *testing.T) {
367367
Optional string `json:"optional,omitempty" enum:"a,b,c"`
368368
}
369369

370-
schema := Generate(reflect.TypeOf(ConfigInput{}))
370+
schema := Generate(reflect.TypeFor[ConfigInput]())
371371

372372
// Check level field
373373
levelSchema := schema.Properties["level"]
@@ -398,7 +398,7 @@ func TestGenerateSchemaComplexTypes(t *testing.T) {
398398
Interface any `json:"interface"`
399399
}
400400

401-
schema := Generate(reflect.TypeOf(ComplexInput{}))
401+
schema := Generate(reflect.TypeFor[ComplexInput]())
402402

403403
// Check string slice
404404
stringSliceSchema := schema.Properties["string_slice"]

0 commit comments

Comments
 (0)