MCPcopy Create free account
hub / github.com/google/gapid / GetOrAppendObservations

Method GetOrAppendObservations

gapis/api/cmd_extras.go:92–99  ·  view source on GitHub ↗

GetOrAppendObservations returns a pointer to the existing Observations structure in the CmdExtras, or appends and returns a pointer to a new observations structure if the CmdExtras does not already contain one.

()

Source from the content-addressed store, hash-verified

90// structure in the CmdExtras, or appends and returns a pointer to a new
91// observations structure if the CmdExtras does not already contain one.
92func (e *CmdExtras) GetOrAppendObservations() *CmdObservations {
93 if o := e.Observations(); o != nil {
94 return o
95 }
96 o := &CmdObservations{}
97 e.Add(o)
98 return o
99}
100
101// WithExtras adds the given extras to a command and returns it.
102func WithExtras(a Cmd, extras ...CmdExtra) Cmd {

Callers 8

RMethod · 0.80
WMethod · 0.80
addMethod · 0.80
deleteCompatFunction · 0.80
readsDataMethod · 0.80
readsSliceMethod · 0.80
writesDataMethod · 0.80
writeMethod · 0.80

Calls 2

ObservationsMethod · 0.95
AddMethod · 0.95

Tested by

no test coverage detected