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

Method GetStringDefault

sessions/session.go:154–160  ·  view source on GitHub ↗

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

(key string, defaultValue string)

Source from the content-addressed store, hash-verified

152// GetStringDefault same as Get but returns its string representation,
153// if key doesn't exist then it returns the "defaultValue".
154func (s *Session) GetStringDefault(key string, defaultValue string) string {
155 if v := s.GetString(key); v != "" {
156 return v
157 }
158
159 return defaultValue
160}
161
162// GetFlashString same as `GetFlash` but returns its string representation,
163// if key doesn't exist then it returns an empty string.

Callers 1

mainFunction · 0.45

Calls 1

GetStringMethod · 0.95

Tested by

no test coverage detected