MCPcopy Create free account
hub / github.com/cel-expr/cel-go / msgWithExtensions

Function msgWithExtensions

ext/protos_test.go:249–259  ·  view source on GitHub ↗

msgWithExtensions generates a new example message with all possible extensions set.

()

Source from the content-addressed store, hash-verified

247
248// msgWithExtensions generates a new example message with all possible extensions set.
249func msgWithExtensions() *proto2pb.ExampleType {
250 msg := &proto2pb.ExampleType{
251 Name: proto.String("example0"),
252 }
253 proto.SetExtension(msg, proto2pb.E_Int32Ext, int32(42))
254 proto.SetExtension(msg, proto2pb.E_Int32WrapperExt, wrapperspb.Int32(21))
255 proto.SetExtension(msg, proto2pb.E_NestedExample, &proto2pb.ExampleType{Name: proto.String("nested")})
256 proto.SetExtension(msg, proto2pb.E_ExtendedExampleType_EnumExt, proto2pb.GlobalEnum_GAZ)
257 proto.SetExtension(msg, proto2pb.E_ExtendedExampleType_ExtendedExamples, []string{"example1", "example2"})
258 return msg
259}

Callers 2

TestProtosFunction · 0.85
TestProtosNonMatchFunction · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected