Skip to content

fix(example): remove res.Data access in Example_listModels after pagination regen#352

Merged
LukasParke merged 1 commit into
mainfrom
fix/example-list-models-pagination
Jul 7, 2026
Merged

fix(example): remove res.Data access in Example_listModels after pagination regen#352
LukasParke merged 1 commit into
mainfrom
fix/example-list-models-pagination

Conversation

@LukasParke

Copy link
Copy Markdown
Contributor

Summary

Fixes the sdk-build-check (go) CI failure blocking PR #27246.

The pagination regeneration removed .Data from the models list response type, but Example_listModels in example_test.go still referenced res.Data, causing a build error.

Change

example_test.goExample_listModels:

// Before
if res != nil && len(res.Data) > 0 {
    fmt.Printf("Found %d models\n", len(res.Data))
    fmt.Printf("First model: %s\n", res.Data[0].Name)
}

// After
if res != nil {
    fmt.Println("Successfully fetched models")
}

The other res.Data references in the file (single-model fetch, providers list) are in different functions with different response types that still carry .Data — those are untouched.

…nation regen

The pagination regeneration removed .Data from the models list response.
Update Example_listModels to only check res != nil instead of accessing
the now-missing res.Data field, fixing the sdk-build-check (go) CI failure.
@LukasParke LukasParke merged commit 2cd48b1 into main Jul 7, 2026
2 checks passed
@LukasParke LukasParke deleted the fix/example-list-models-pagination branch July 7, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant