maps

package
v0.0.0-...-82e7740 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package maps implements map utility functions.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseURLQuery

func ParseURLQuery(params string) map[string]string

ParseURLQuery returns the map by the params(url query). eg. key1=value1&key2=value2 => map[key1:value1 key2:value2]

Example
package main

import (
	"fmt"

	"gopkg.in/goyy/goyy.v0/util/maps"
)

func main() {
	fmt.Println(maps.ParseURLQuery("key1=value1&key2=value2"))
	fmt.Println(maps.ParseURLQuery("key1=value1"))
	fmt.Println(maps.ParseURLQuery("key1="))
	fmt.Println(maps.ParseURLQuery("=val1"))
	fmt.Println(maps.ParseURLQuery("="))
	fmt.Println(maps.ParseURLQuery(""))
	fmt.Println(maps.ParseURLQuery(" "))

}
Output:

map[key1:value1 key2:value2]
map[key1:value1]
map[key1:]
map[]
map[]
map[]
map[]

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL