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

Method boolValue

binder.go:926–939  ·  view source on GitHub ↗
(sourceParam string, dest *bool, valueMustExist bool)

Source from the content-addressed store, hash-verified

924}
925
926func (b *ValueBinder) boolValue(sourceParam string, dest *bool, valueMustExist bool) *ValueBinder {
927 if b.failFast && b.errors != nil {
928 return b
929 }
930
931 value := b.ValueFunc(sourceParam)
932 if value == "" {
933 if valueMustExist {
934 b.setError(b.ErrorFunc(sourceParam, []string{}, "required field value is empty", nil))
935 }
936 return b
937 }
938 return b.bool(sourceParam, value, dest)
939}
940
941func (b *ValueBinder) bool(sourceParam string, value string, dest *bool) *ValueBinder {
942 n, err := strconv.ParseBool(value)

Callers 2

BoolMethod · 0.95
MustBoolMethod · 0.95

Calls 2

setErrorMethod · 0.95
boolMethod · 0.95

Tested by

no test coverage detected