msgWithExtensions generates a new example message with all possible extensions set.
()
| 247 | |
| 248 | // msgWithExtensions generates a new example message with all possible extensions set. |
| 249 | func 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 | } |
no test coverage detected