MCPcopy Index your code
hub / github.com/labstack/echo / ParseValue

Function ParseValue

binder_generic.go:366–369  ·  view source on GitHub ↗

ParseValue parses value to generic type Types that are supported: - bool - float32 - float64 - int - int8 - int16 - int32 - int64 - uint - uint8/byte - uint16 - uint32 - uint64 - string - echo.BindUnmarshaler interface - encoding.TextUnmarshaler interface - json.Unmarshaler interface - time.Duratio

(value string, opts ...any)

Source from the content-addressed store, hash-verified

364// - time.Duration
365// - time.Time use echo.TimeOpts or echo.TimeLayout to set time parsing configuration
366func ParseValue[T any](value string, opts ...any) (T, error) {
367 var zero T
368 return ParseValueOr(value, zero, opts...)
369}
370
371// ParseValueOr parses value to generic type, when value is empty defaultValue is returned.
372//

Callers 1

TestParseValue_TimeFunction · 0.85

Calls 1

ParseValueOrFunction · 0.85

Tested by 1

TestParseValue_TimeFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…