statusCodeToGRPCConst produces the standard name for the given gRPC status code. If no standard name exists then the string consisting of the code integer value is returned.
(code int)
| 10 | // code. If no standard name exists then the string consisting of the code |
| 11 | // integer value is returned. |
| 12 | func statusCodeToGRPCConst(code int) string { |
| 13 | if v, ok := statusCodeToConst[code]; ok { |
| 14 | return fmt.Sprintf("codes.%s", v) |
| 15 | } |
| 16 | return fmt.Sprintf("%d", code) |
| 17 | } |
| 18 | |
| 19 | var statusCodeToConst = map[int]string{ |
| 20 | dsl.CodeOK: "OK", |
no outgoing calls
no test coverage detected