ByName returns the value of the first Param which key matches the given name. If no matching Param is found, an empty string is returned.
(name string)
| 101 | // ByName returns the value of the first Param which key matches the given name. |
| 102 | // If no matching Param is found, an empty string is returned. |
| 103 | func (ps Params) ByName(name string) string { |
| 104 | for i := range ps { |
| 105 | if ps[i].Key == name { |
| 106 | return ps[i].Value |
| 107 | } |
| 108 | } |
| 109 | return "" |
| 110 | } |
| 111 | |
| 112 | type paramsKey struct{} |
| 113 |
no outgoing calls