Files
oikos/vendor/github.com/openai/openai-go/packages/param/null.go
dtoro febc153b7f
Some checks failed
ci / build-test (push) Has been cancelled
ci / docker-build (push) Has been cancelled
ci / web (push) Has been cancelled
Desktop App / Build Linux (amd64) (push) Has been cancelled
Desktop App / Attach to Release (push) Has been cancelled
fix: add involves edge from task to agent:nomos at creation
Plus sync vendor directory for Docker build compatibility.
2026-08-11 22:03:12 +02:00

20 lines
762 B
Go

package param
import "github.com/openai/openai-go/internal/encoding/json/sentinel"
// NullMap returns a non-nil map with a length of 0.
// When used with [MarshalObject] or [MarshalUnion], it will be marshaled as null.
//
// It is unspecified behavior to mutate the map returned by [NullMap].
func NullMap[MapT ~map[string]T, T any]() MapT {
return sentinel.NewNullSentinel(func() MapT { return make(MapT, 1) })
}
// NullSlice returns a non-nil slice with a length of 0.
// When used with [MarshalObject] or [MarshalUnion], it will be marshaled as null.
//
// It is unspecified behavior to mutate the slice returned by [NullSlice].
func NullSlice[SliceT ~[]T, T any]() SliceT {
return sentinel.NewNullSentinel(func() SliceT { return make(SliceT, 0, 1) })
}