Get returns the value of the first Param which key matches the given name and a boolean true. If no matching Param is found, an empty string is returned and a boolean false .
(name string)
| 27 | // Get returns the value of the first Param which key matches the given name and a boolean true. |
| 28 | // If no matching Param is found, an empty string is returned and a boolean false . |
| 29 | func (ps Params) Get(name string) (string, bool) { |
| 30 | for _, entry := range ps { |
| 31 | if entry.Key == name { |
| 32 | return entry.Value, true |
| 33 | } |
| 34 | } |
| 35 | return "", false |
| 36 | } |
| 37 | |
| 38 | // ByName returns the value of the first Param which key matches the given name. |
| 39 | // If no matching Param is found, an empty string is returned. |
no outgoing calls