MCPcopy Index your code
hub / github.com/coder/coder / normalizeMetadataKey

Function normalizeMetadataKey

coderd/x/chatd/chatloop/chatloop.go:2106–2122  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

2104}
2105
2106func normalizeMetadataKey(key string) string {
2107 var b strings.Builder
2108 b.Grow(len(key))
2109
2110 for _, r := range key {
2111 switch {
2112 case r >= 'a' && r <= 'z':
2113 _, _ = b.WriteRune(r)
2114 case r >= 'A' && r <= 'Z':
2115 _, _ = b.WriteRune(r + ('a' - 'A'))
2116 case r >= '0' && r <= '9':
2117 _, _ = b.WriteRune(r)
2118 }
2119 }
2120
2121 return b.String()
2122}
2123
2124func metadataKeyWords(key string) []string {
2125 words := make([]string, 0, 4)

Callers 2

isContextLimitKeyFunction · 0.85
TestNormalizeMetadataKeyFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by 1

TestNormalizeMetadataKeyFunction · 0.68