From go.vim Vim syntax file:
" There are some options for customizing the highlighting; the recommended " settings are the default values, but you can write: " let OPTION_NAME = 0 " in your ~/.vimrc file to disable particular options.
Insert your .vimrc
let g:go_highlight_trailing_whitespace_error=0
The options are as follows:
" - g:go_highlight_array_whitespace_error " Highlights white space after "[]". " - g:go_highlight_chan_whitespace_error " Highlights white space around the communications operator that don't " follow the standard style. " - g:go_highlight_extra_types " Highlights commonly used library types (io.Reader, etc.). " - g:go_highlight_space_tab_error " Highlights instances of tabs following spaces.
If you still like to highlight trailing spaces, but not during input, you can try
au InsertEnter *.go match goSpaceError /\s\+\%
Read more in Highlight unwanted spaces from wikia .
source share