MCPcopy Create free account
hub / github.com/CrunchyData/postgres-operator / FromPointer

Function FromPointer

internal/initialize/primitives.go:12–18  ·  view source on GitHub ↗

FromPointer returns the value that p points to. When p is nil, it returns the zero value of T.

(p *T)

Source from the content-addressed store, hash-verified

10// FromPointer returns the value that p points to.
11// When p is nil, it returns the zero value of T.
12func FromPointer[T any](p *T) T {
13 var v T
14 if p != nil {
15 v = *p
16 }
17 return v
18}
19
20// Int32 returns a pointer to v.
21func Int32(v int32) *int32 { return &v }

Callers 15

generateUpgradeJobMethod · 0.92
generateRemoveDataJobMethod · 0.92
ReconcileMethod · 0.92
reconcileMoveWALDirMethod · 0.92
reconcileMoveRepoDirMethod · 0.92

Calls

no outgoing calls

Tested by 1

TestFromPointerFunction · 0.74