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

Function funcToProducer

core/event/function.go:104–116  ·  view source on GitHub ↗
(ctx context.Context, f reflect.Value)

Source from the content-addressed store, hash-verified

102}
103
104func funcToProducer(ctx context.Context, f reflect.Value) Producer {
105 _, err := checkSignature(ctx, f.Type(),
106 []reflect.Type{contextType},
107 []reflect.Type{nil},
108 )
109 if err != nil {
110 log.F(ctx, true, "Checking producer signature. Error: %v", err)
111 }
112 return func(ctx context.Context) interface{} {
113 args := []reflect.Value{reflect.ValueOf(ctx)}
114 return safeObject(f.Call(args)[0])
115 }
116}
117
118func funcToPredicate(ctx context.Context, f reflect.Value) Predicate {
119 t, err := checkSignature(ctx, f.Type(),

Callers 1

AsProducerFunction · 0.85

Calls 5

checkSignatureFunction · 0.85
safeObjectFunction · 0.85
FMethod · 0.80
TypeMethod · 0.65
CallMethod · 0.65

Tested by

no test coverage detected