MCPcopy
hub / github.com/grpc/grpc-go / AppendH2ToNextProtos

Function AppendH2ToNextProtos

internal/credentials/util.go:28–37  ·  view source on GitHub ↗

AppendH2ToNextProtos appends h2 to next protos.

(ps []string)

Source from the content-addressed store, hash-verified

26
27// AppendH2ToNextProtos appends h2 to next protos.
28func AppendH2ToNextProtos(ps []string) []string {
29 for _, p := range ps {
30 if p == alpnProtoStrH2 {
31 return ps
32 }
33 }
34 ret := make([]string, 0, len(ps)+1)
35 ret = append(ret, ps...)
36 return append(ret, alpnProtoStrH2)
37}
38
39// CloneTLSConfig returns a shallow clone of the exported
40// fields of cfg, ignoring the unexported sync.Once, which

Callers 1

Calls

no outgoing calls

Tested by 1