checkPairs returns the count of strings passed in, and an error if the count is not an even number.
(pairs ...string)
| 493 | // checkPairs returns the count of strings passed in, and an error if |
| 494 | // the count is not an even number. |
| 495 | func checkPairs(pairs ...string) (int, error) { |
| 496 | length := len(pairs) |
| 497 | if length%2 != 0 { |
| 498 | return length, fmt.Errorf( |
| 499 | "mux: number of parameters must be multiple of 2, got %v", pairs) |
| 500 | } |
| 501 | return length, nil |
| 502 | } |
| 503 | |
| 504 | // mapFromPairsToString converts variadic string parameters to a |
| 505 | // string to string map. |
no outgoing calls
no test coverage detected