(ctx context.Context, _ *testpb.Empty)
| 152 | } |
| 153 | |
| 154 | func (s *testServer) EmptyCall(ctx context.Context, _ *testpb.Empty) (*testpb.Empty, error) { |
| 155 | if md, ok := metadata.FromIncomingContext(ctx); ok { |
| 156 | // For testing purpose, returns an error if user-agent is failAppUA. |
| 157 | // To test that client gets the correct error. |
| 158 | if ua, ok := md["user-agent"]; !ok || strings.HasPrefix(ua[0], failAppUA) { |
| 159 | return nil, detailedError |
| 160 | } |
| 161 | var str []string |
| 162 | for _, entry := range md["user-agent"] { |
| 163 | str = append(str, "ua", entry) |
| 164 | } |
| 165 | grpc.SendHeader(ctx, metadata.Pairs(str...)) |
| 166 | } |
| 167 | return new(testpb.Empty), nil |
| 168 | } |
| 169 | |
| 170 | func newPayload(t testpb.PayloadType, size int32) (*testpb.Payload, error) { |
| 171 | if size < 0 { |
nothing calls this directly
no test coverage detected