trimQuotes strips a single matching pair of surrounding ASCII quotes.
(s string)
| 139 | |
| 140 | // trimQuotes strips a single matching pair of surrounding ASCII quotes. |
| 141 | func trimQuotes(s string) string { |
| 142 | if len(s) < 2 { |
| 143 | return s |
| 144 | } |
| 145 | if (s[0] == '"' && s[len(s)-1] == '"') || (s[0] == '\'' && s[len(s)-1] == '\'') { |
| 146 | return s[1 : len(s)-1] |
| 147 | } |
| 148 | return s |
| 149 | } |
| 150 | |
| 151 | // extractQueryArg is a convenience wrapper for builtins that show a |
| 152 | // query string in the spinner. Tries the common key names used by both |
no outgoing calls