MCPcopy Create free account
hub / github.com/kataras/iris / PostValueFloat32Default

Method PostValueFloat32Default

context/context.go:2191–2198  ·  view source on GitHub ↗

PostValueFloat32Default same as PostValueFloat32 but if errored it returns the given "def" default value.

(name string, def float32)

Source from the content-addressed store, hash-verified

2189// PostValueFloat32Default same as PostValueFloat32 but if errored it returns
2190// the given "def" default value.
2191func (ctx *Context) PostValueFloat32Default(name string, def float32) float32 {
2192 value, err := ctx.PostValueFloat32(name)
2193 if err != nil {
2194 return def
2195 }
2196
2197 return value
2198}
2199
2200// PostValueFloat64 returns the last parsed form data matches the given "name" key
2201// from POST, PATCH, or PUT body request parameters as float64.

Callers

nothing calls this directly

Calls 1

PostValueFloat32Method · 0.95

Tested by

no test coverage detected