DecodeQuery returns the uri parameter as url (string) useful when you want to pass something to a database and be valid to retrieve it via context.Param use it only for special cases, when the default behavior doesn't suits you. http://www.blooberry.com/indexdot/html/topics/urlencoding.htm it uses
(path string)
| 902 | // http://www.blooberry.com/indexdot/html/topics/urlencoding.htm |
| 903 | // it uses just the url.QueryUnescape |
| 904 | func DecodeQuery(path string) string { |
| 905 | if path == "" { |
| 906 | return "" |
| 907 | } |
| 908 | encodedPath, err := url.QueryUnescape(path) |
| 909 | if err != nil { |
| 910 | return path |
| 911 | } |
| 912 | return encodedPath |
| 913 | } |
| 914 | |
| 915 | // DecodeURL returns the decoded uri |
| 916 | // useful when you want to pass something to a database and be valid to retrieve it via context.Param |
no outgoing calls
no test coverage detected
searching dependent graphs…