github.com/coincircle/mattermost-server@v4.8.1-0.20180321182714-9d701c704416+incompatible/utils/urlencode.go (about) 1 // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. 2 // See License.txt for license information. 3 4 package utils 5 6 import ( 7 "net/url" 8 "strings" 9 ) 10 11 func UrlEncode(str string) string { 12 strs := strings.Split(str, " ") 13 14 for i, s := range strs { 15 strs[i] = url.QueryEscape(s) 16 } 17 18 return strings.Join(strs, "%20") 19 }