Go: Add gotype support (#1099)

This commit is contained in:
Jelte Fennema 2018-01-07 13:11:01 +01:00 committed by w0rp
parent c9d66b861b
commit b6d1c41925
6 changed files with 51 additions and 2 deletions

View file

@ -236,6 +236,13 @@ function! ale#util#EscapePCRE(unsafe_string) abort
return substitute(a:unsafe_string, '\([\-\[\]{}()*+?.^$|]\)', '\\\1', 'g')
endfunction
" Escape a string so that it can be used as a literal string inside an evaled
" vim command.
function! ale#util#EscapeVim(unsafe_string) abort
return "'" . substitute(a:unsafe_string, "'", "''", 'g') . "'"
endfunction
" Given a String or a List of String values, try and decode the string(s)
" as a JSON value which can be decoded with json_decode. If the JSON string
" is invalid, the default argument value will be returned instead.