MCPcopy
hub / github.com/riverqueue/river / Ptr

Function Ptr

rivershared/util/ptrutil/ptr_util.go:4–6  ·  view source on GitHub ↗

Ptr returns a pointer to the given value.

(v T)

Source from the content-addressed store, hash-verified

2
3// Ptr returns a pointer to the given value.
4func Ptr[T any](v T) *T {
5 return &v
6}
7
8// ValOrDefault returns the value of the given pointer as long as it's non-nil,
9// and the specified default value otherwise.

Callers 15

Test_SubscriptionManagerFunction · 0.92
TestJobCompleteTxFunction · 0.92
Test_Client_JobListFunction · 0.92
Test_Client_MaintenanceFunction · 0.92
TestResumableSetStepTxFunction · 0.92
testProducerFunction · 0.92
TestTestSchemaFunction · 0.92
Job_BuildFunction · 0.92
JobInsertFullMethod · 0.92

Calls

no outgoing calls

Tested by 15

Test_SubscriptionManagerFunction · 0.74
TestJobCompleteTxFunction · 0.74
Test_Client_JobListFunction · 0.74
Test_Client_MaintenanceFunction · 0.74
TestResumableSetStepTxFunction · 0.74
testProducerFunction · 0.74
TestTestSchemaFunction · 0.74
TestTimeStringNullableFunction · 0.74
TestJobSchedulerFunction · 0.74
TestJobRescuerFunction · 0.74