MCPcopy Create free account
hub / github.com/goadesign/goa / PreviouslySeen

Method PreviouslySeen

expr/random.go:77–85  ·  view source on GitHub ↗

PreviouslySeen returns the previously seen value for a given ID

(typeID string)

Source from the content-addressed store, hash-verified

75
76// PreviouslySeen returns the previously seen value for a given ID
77func (r *ExampleGenerator) PreviouslySeen(typeID string) (*any, bool) {
78 r.mu.RLock()
79 defer r.mu.RUnlock()
80 if r.seen == nil {
81 return nil, false
82 }
83 val, haveSeen := r.seen[typeID]
84 return val, haveSeen
85}
86
87// HaveSeen stores the seen value in the randomizer, for reuse later
88func (r *ExampleGenerator) HaveSeen(typeID string, val *any) {

Callers 1

recExampleMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected