@@ -144,15 +144,16 @@ function! go#lint#Diagnostics(bang, ...) abort
144
144
145
145
let l: listtype = go#list#Type (" GoDiagnostics" )
146
146
147
- if len (l: messages ) == 0
147
+ " Parse and populate the quickfix list
148
+ let l: winid = win_getid (winnr ())
149
+ call go#list#ParseFormat (l: listtype , l: errformat , l: messages , ' GoDiagnostics' , 0 )
150
+
151
+ let l: errors = go#list#Get (l: listtype )
152
+
153
+ if len (l: errors ) == 0
148
154
call go#list#Clean (l: listtype )
149
155
call go#util#EchoSuccess (' [diagnostics] PASS' )
150
156
else
151
- " Parse and populate the quickfix list
152
- let l: winid = win_getid (winnr ())
153
- call go#list#ParseFormat (l: listtype , l: errformat , l: messages , ' GoDiagnostics' , 0 )
154
-
155
- let errors = go#list#Get (l: listtype )
156
157
call go#list#Window (l: listtype , len (errors))
157
158
158
159
if a: bang
@@ -467,7 +468,11 @@ function! s:errorformat(metalinter) abort
467
468
elseif a: metalinter == ' staticcheck'
468
469
return ' %f:%l:%c:\ %m'
469
470
elseif a: metalinter == ' gopls'
470
- return ' %f:%l:%c:%t:\ %m,%f:%l:%c::\ %m,%f:%l::%t:\ %m'
471
+ let l: efm = ' '
472
+ if go#config#DiagnosticsIgnoreWarnings ()
473
+ let l: efm = ' %-G%f:%l:%c:W:\ %m,%-G%f:%l::W:\ %m,'
474
+ endif
475
+ return l: efm . ' %f:%l:%c:%t:\ %m,%f:%l:%c::\ %m,%f:%l::%t:\ %m'
471
476
endif
472
477
endfunction
473
478
0 commit comments