(header, trailer metadata.MD)
| 498 | ) |
| 499 | |
| 500 | func validateMetadata(header, trailer metadata.MD) { |
| 501 | if len(header[initialMetadataKey]) != 1 { |
| 502 | logger.Fatalf("Expected exactly one header from server. Received %d", len(header[initialMetadataKey])) |
| 503 | } |
| 504 | if header[initialMetadataKey][0] != initialMetadataValue { |
| 505 | logger.Fatalf("Got header %s; want %s", header[initialMetadataKey][0], initialMetadataValue) |
| 506 | } |
| 507 | if len(trailer[trailingMetadataKey]) != 1 { |
| 508 | logger.Fatalf("Expected exactly one trailer from server. Received %d", len(trailer[trailingMetadataKey])) |
| 509 | } |
| 510 | if trailer[trailingMetadataKey][0] != trailingMetadataValue { |
| 511 | logger.Fatalf("Got trailer %s; want %s", trailer[trailingMetadataKey][0], trailingMetadataValue) |
| 512 | } |
| 513 | } |
| 514 | |
| 515 | // DoCustomMetadata checks that metadata is echoed back to the client. |
| 516 | func DoCustomMetadata(ctx context.Context, tc testgrpc.TestServiceClient, args ...grpc.CallOption) { |
no test coverage detected