func QueryEscape(s string) string {
	return escape(s, encodeQueryComponent)
}
QueryEscape escapes the string so it can be safely placed
inside a URL query.
package urlesc
import (
	"bytes"
	"net/url"
	"strings"
)
type encoding int
const (
	encodePath encoding = 1 + iota
	encodeUserPassword
	encodeQueryComponent
	encodeFragment
)
func shouldEscape(c byte, mode encoding) bool {
	if 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' || '0' <= c && c <= '9' {
		return false
	}
	switch c {
	case '-', '.', '_', '~':  
		return false
	case ':', '/', '?', '#', '[', ']', '@',  
		'!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=':  
		switch mode {
		case encodePath:  
			return c == '?' || c == '#'
		case encodeUserPassword:  
			return c == ':' || c == '/' || c == '?' || c == '#' || c == '[' || c == ']' || c == '@'
		case encodeQueryComponent:  
			return c != '/' && c != '?'
		case encodeFragment:  
			return c == '#'
		}
	}
	return true
}