MCPcopy Create free account
hub / github.com/goadesign/goa / statusCodeToGRPCConst

Function statusCodeToGRPCConst

grpc/codegen/funcs.go:12–17  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

10// code. If no standard name exists then the string consisting of the code
11// integer value is returned.
12func 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
19var statusCodeToConst = map[int]string{
20 dsl.CodeOK: "OK",

Callers 2

analyzeMethod · 0.85
buildErrorsDataMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected