Skip to content

Location list not being parsed correctly if setting g:go_metalinter_command #3728

@bitwombat

Description

@bitwombat

What did you do?

I set g:go_metalinter_command to the same command I could see :GoMetalinter running when I had g:go_debug=['shell-commands'] set.

:let g:go_metalinter_command="/home/me/go/bin/golangci-lint run --show-stats=false --output.text.print-issued-lines=false --build-tags playground --path-mode abs --default=none --enable=govet --enable=revive --enable=errcheck /prj/listen-later/service"

And then I ran :GoMetalinter

What did you expect to happen?

I expected navigable quickfix output like this, which is what it does if I don't set go_metalinter_command:

service/update.go|30 col 9| Non-inherited new context, use function like `context.WithXXX` or `r.Context` instead (contextcheck)                                                                                    
service/update_test.go|67 col 8| Error return value is not checked (errcheck)

What happened instead?

I got un-parsed output in a non-navigable quickfix list:

|| /prj/listen-later/service/update.go:30:9: Non-inherited new context, use function like `context.WithXXX` or `r.Context` instead (contextcheck)                                     
|| /prj/listen-later/service/update_test.go:67:8: Error return value is not checked (errcheck)                   

Configuration (MUST fill this out):

vim-go version:

master/06ac993

vimrc you used to reproduce:

vimrc
let g:go_gopls_enabled = 1
let g:go_auto_type_info = 1

if !filereadable(vimplug_exists)
  if !executable(curl_exists)
    echoerr "You have to install curl or first install vim-plug yourself!"
    execute "q!"
  endif
  echo "Installing Vim-Plug..."
  echo ""
  silent exec "!"curl_exists" -fLo " . shellescape(vimplug_exists) . " --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim"
  let g:not_finish_vimplug = "yes"

  autocmd VimEnter * PlugInstall
endif

" Required:
call plug#begin(expand('~/.vim/plugged'))

"*****************************************************************************
"" Plug install packages
"*****************************************************************************
Plug 'fatih/vim-go', {'do': ':GoInstallBinaries'}

" Initialize plugin system
call plug#end()

Vim version (first three lines from :version):

VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Sep 05 2025 19:44:46)
Included patches: 1-16, 647, 678, 697
Modified by [email protected]

I've not included a the configurations below because I believe they are n/a and am trying to save the sanitizing effort. If they are of interest, my apologies, and I will provide them.

Go version (go version):

n/a

Go environment

go env Output:
n/a

gopls version

gopls version Output:
n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions