MCPcopy
hub / github.com/gorilla/mux / checkPairs

Function checkPairs

mux.go:495–502  ·  view source on GitHub ↗

checkPairs returns the count of strings passed in, and an error if the count is not an even number.

(pairs ...string)

Source from the content-addressed store, hash-verified

493// checkPairs returns the count of strings passed in, and an error if
494// the count is not an even number.
495func 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.

Callers 2

mapFromPairsToStringFunction · 0.85
mapFromPairsToRegexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected