gorilla_imported.go 317 B

1234567891011121314
  1. package ui
  2. // mapToPairs converts a string map to a slice of string pairs
  3. // Part of the mux_test.go file in Gorilla Mux, used under its BSD-like license.
  4. func mapToPairs(m map[string]string) []string {
  5. var i int
  6. p := make([]string, len(m)*2)
  7. for k, v := range m {
  8. p[i] = k
  9. p[i+1] = v
  10. i += 2
  11. }
  12. return p
  13. }