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

Method GetFloat32Default

sessions/session.go:393–399  ·  view source on GitHub ↗

GetFloat32Default same as `Get` but returns its float32 representation, if key doesn't exist then it returns the "defaultValue".

(key string, defaultValue float32)

Source from the content-addressed store, hash-verified

391// GetFloat32Default same as `Get` but returns its float32 representation,
392// if key doesn't exist then it returns the "defaultValue".
393func (s *Session) GetFloat32Default(key string, defaultValue float32) float32 {
394 if v, err := s.GetFloat32(key); err == nil {
395 return v
396 }
397
398 return defaultValue
399}
400
401// GetFloat64 same as `Get` but returns its float64 representation,
402// if key doesn't exist then it returns -1 and a non-nil error.

Callers

nothing calls this directly

Calls 1

GetFloat32Method · 0.95

Tested by

no test coverage detected