MCPcopy Create free account
hub / github.com/alecthomas/kong / parseStructTagItems

Function parseStructTagItems

tag.go:169–188  ·  view source on GitHub ↗
(tag reflect.StructTag)

Source from the content-addressed store, hash-verified

167}
168
169func parseStructTagItems(tag reflect.StructTag) (map[string][]string, error) {
170 items, err := parseTagItems(string(tag), bareChars)
171 if err != nil {
172 return nil, err
173 }
174 delete(items, "kong")
175
176 kongTag, ok := tag.Lookup("kong")
177 if !ok {
178 return items, nil
179 }
180 kongItems, err := parseTagItems(kongTag, kongChars)
181 if err != nil {
182 return nil, err
183 }
184 for key, value := range kongItems {
185 items[key] = append(value, items[key]...)
186 }
187 return items, nil
188}
189
190func newEmptyTag() *Tag {
191 return &Tag{items: map[string][]string{}}

Callers 1

parseTagFunction · 0.85

Calls 1

parseTagItemsFunction · 0.85

Tested by

no test coverage detected