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

Method PopValue

scanner.go:172–178  ·  view source on GitHub ↗

PopValue pops a value token, or returns an error. "context" is used to assist the user if the value can not be popped, eg. "expected value but got "

(context string)

Source from the content-addressed store, hash-verified

170//
171// "context" is used to assist the user if the value can not be popped, eg. "expected <context> value but got <type>"
172func (s *Scanner) PopValue(context string) (Token, error) {
173 t := s.Pop()
174 if !s.allowHyphenated && !t.IsValue() {
175 return t, &expectedError{context, t}
176 }
177 return t, nil
178}
179
180// PopValueInto pops a value token into target or returns an error.
181//

Callers 6

PopValueIntoMethod · 0.95
durationDecoderFunction · 0.80
intDecoderFunction · 0.80
uintDecoderFunction · 0.80
floatDecoderFunction · 0.80
counterMapperFunction · 0.80

Calls 2

PopMethod · 0.95
IsValueMethod · 0.80

Tested by

no test coverage detected