File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ package paramutil
2+
3+ import (
4+ "github.com/anthropics/anthropic-sdk-go/internal/encoding/json/sentinel"
5+ )
6+
7+ // NullPtr returns a pointer to the zero value of the type T.
8+ // When used with [MarshalObject] or [MarshalUnion], it will be marshaled as null.
9+ //
10+ // It is unspecified behavior to mutate the value pointed to by the returned pointer.
11+ func NullPtr [T any ]() * T {
12+ return sentinel .NullPtr [T ]()
13+ }
14+
15+ // IsNullPtr returns true if the pointer was created by [NullPtr].
16+ func IsNullPtr [T any ](ptr * T ) bool {
17+ return sentinel .IsNullPtr (ptr )
18+ }
19+
20+ // NullSlice returns a non-nil slice with a length of 0.
21+ // When used with [MarshalObject] or [MarshalUnion], it will be marshaled as null.
22+ //
23+ // It is undefined behavior to mutate the slice returned by [NullSlice].
24+ func NullSlice [T any ]() []T {
25+ return sentinel .NullSlice [T ]()
26+ }
27+
28+ // IsNullSlice returns true if the slice was created by [NullSlice].
29+ func IsNullSlice [T any ](slice []T ) bool {
30+ return sentinel .IsNullSlice (slice )
31+ }
You can’t perform that action at this time.
0 commit comments