databricks-sdk-go
databricks-sdk-go copied to clipboard
Primitive response types return pointer value
For example:
// Skip this test if "Files in Repos" is not enabled.
conf, err := wsc.WorkspaceConf.GetStatus(ctx, workspaceconf.GetStatusRequest{
Keys: "enableWorkspaceFilesystem",
})
require.NoError(t, err)
if (*conf)["enableWorkspaceFilesystem"] == "false" {
The response to this call is type'd as map[string]string: https://github.com/databricks/databricks-sdk-go/blob/93c04abbb235ed263a0f0ee24ed2970cbd7c0278/service/workspaceconf/model.go#L11
It is returned as pointer here: https://github.com/databricks/databricks-sdk-go/blob/93c04abbb235ed263a0f0ee24ed2970cbd7c0278/service/workspaceconf/api.go#L24-L29
It would be better UX to not return a pointer here, as the map type itself is nillable and now requires pointer dereference.