MCPcopy
hub / github.com/labstack/echo / MustStrings

Method MustStrings

binder.go:298–310  ·  view source on GitHub ↗

MustStrings requires parameter values to exist to bind to slice of string variables. Returns error when value does not exist

(sourceParam string, dest *[]string)

Source from the content-addressed store, hash-verified

296
297// MustStrings requires parameter values to exist to bind to slice of string variables. Returns error when value does not exist
298func (b *ValueBinder) MustStrings(sourceParam string, dest *[]string) *ValueBinder {
299 if b.failFast && b.errors != nil {
300 return b
301 }
302
303 value := b.ValuesFunc(sourceParam)
304 if value == nil {
305 b.setError(b.ErrorFunc(sourceParam, []string{}, "required field value is empty", nil))
306 return b
307 }
308 *dest = value
309 return b
310}
311
312// BindUnmarshaler binds parameter to destination implementing BindUnmarshaler interface
313func (b *ValueBinder) BindUnmarshaler(sourceParam string, dest BindUnmarshaler) *ValueBinder {

Callers 1

TestValueBinder_StringsFunction · 0.80

Calls 1

setErrorMethod · 0.95

Tested by 1

TestValueBinder_StringsFunction · 0.64