Fix lint errors

This commit is contained in:
世界
2026-05-13 22:37:05 +08:00
parent 429182a349
commit a47f39fa2b
79 changed files with 219 additions and 667 deletions

View File

@@ -20,16 +20,15 @@ package credentials
import (
"crypto/tls"
"slices"
)
const alpnProtoStrH2 = "h2"
// AppendH2ToNextProtos appends h2 to next protos.
func AppendH2ToNextProtos(ps []string) []string {
for _, p := range ps {
if p == alpnProtoStrH2 {
return ps
}
if slices.Contains(ps, alpnProtoStrH2) {
return ps
}
ret := make([]string, 0, len(ps)+1)
ret = append(ret, ps...)