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

Function uniqueVars

mux.go:482–491  ·  view source on GitHub ↗

uniqueVars returns an error if two slices contain duplicated strings.

(s1, s2 []string)

Source from the content-addressed store, hash-verified

480
481// uniqueVars returns an error if two slices contain duplicated strings.
482func uniqueVars(s1, s2 []string) error {
483 for _, v1 := range s1 {
484 for _, v2 := range s2 {
485 if v1 == v2 {
486 return fmt.Errorf("mux: duplicated route variable %q", v2)
487 }
488 }
489 }
490 return nil
491}
492
493// checkPairs returns the count of strings passed in, and an error if
494// the count is not an even number.

Callers 1

addRegexpMatcherMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected