Last returns the last value for a specific key, if the key exists and has values; otherwise returns an empty string, with the "ok" flag set to false.
(key string)
| 393 | // Last returns the last value for a specific key, if the key exists and has |
| 394 | // values; otherwise returns an empty string, with the "ok" flag set to false. |
| 395 | func (m MetaExpr) Last(key string) (string, bool) { |
| 396 | v, ok := m[key] |
| 397 | if !ok { |
| 398 | return "", false |
| 399 | } |
| 400 | |
| 401 | l := len(v) |
| 402 | if l < 1 { |
| 403 | return "", false |
| 404 | } |
| 405 | |
| 406 | return v[l-1], true |
| 407 | } |
no outgoing calls