Confirm this is a Go library issue and not an underlying Cloudflare API issue
Describe the bug
When calling Workers.Scripts.ScriptAndVersionSettings.Get(), the SDK panics if the API returns an empty placement object ("placement": {}).
Panic:
reflect: call of reflect.Value.SetString on struct Value
Reproduction:
settings, err := client.Workers.Scripts.ScriptAndVersionSettings.Get(ctx, "my-worker",
workers.ScriptScriptAndVersionSettingGetParams{
AccountID: cloudflare.F("..."),
})
// panics before returning — err is never set
The API response contains:
{
result: {
placement: {},
bindings: [ ... ],
...
}
}
The panic occurs in the union deserializer for the Placement field (ScriptScriptAndVersionSettingGetResponsePlacement). When the API returns an empty object {} for placement, the reflection-based union deserialization attempts to call SetString on a struct value, which is invalid.
Impact: The entire settings response is lost, including unrelated fields like bindings, compatibility_date, compatibility_flags, and tail_consumers. There is no way to catch this via the returned error — the panic must be caught with recover(), but at that point the response pointer is nil.
SDK version: cloudflare-go/v6 v6.6.0
To Reproduce
settings, err := client.Workers.Scripts.ScriptAndVersionSettings.Get(ctx, "my-worker",
workers.ScriptScriptAndVersionSettingGetParams{
AccountID: cloudflare.F("..."),
})
// panics before returning — err is never set
The API response contains:
{
result: {
placement: {},
bindings: [ ... ],
...
}
}
### Code snippets
```Go
OS
macOs
Go version
go version go1.25.1 darwin/arm64
Library version
SDK version: cloudflare-go/v6 v6.6.0
Confirm this is a Go library issue and not an underlying Cloudflare API issue
Describe the bug
When calling Workers.Scripts.ScriptAndVersionSettings.Get(), the SDK panics if the API returns an empty placement object ("placement": {}).
Panic:
reflect: call of reflect.Value.SetString on struct Value
Reproduction:
The panic occurs in the union deserializer for the Placement field (
ScriptScriptAndVersionSettingGetResponsePlacement). When the API returns an empty object {} for placement, the reflection-based union deserialization attempts to call SetString on a struct value, which is invalid.Impact: The entire settings response is lost, including unrelated fields like bindings, compatibility_date, compatibility_flags, and tail_consumers. There is no way to catch this via the returned error — the panic must be caught with recover(), but at that point the response pointer is nil.
SDK version: cloudflare-go/v6 v6.6.0
To Reproduce
OS
macOs
Go version
go version go1.25.1 darwin/arm64
Library version
SDK version: cloudflare-go/v6 v6.6.0