MCPcopy
hub / github.com/alecthomas/kong / buildGroupForKey

Function buildGroupForKey

build.go:382–397  ·  view source on GitHub ↗
(k *Kong, key string)

Source from the content-addressed store, hash-verified

380}
381
382func buildGroupForKey(k *Kong, key string) *Group {
383 if key == "" {
384 return nil
385 }
386 for _, group := range k.groups {
387 if group.Key == key {
388 return &group
389 }
390 }
391
392 // No group provided with kong.ExplicitGroups. We create one ad-hoc for this key.
393 return &Group{
394 Key: key,
395 Title: key,
396 }
397}
398
399func checkDuplicateNames(node *Node, v reflect.Value) error {
400 seenNames := make(map[string]struct{})

Callers 2

buildChildFunction · 0.85
buildFieldFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…