Skip to content

Commit

Permalink
Merge pull request #671 from hori-ryota/feature/fixed-errcheck
Browse files Browse the repository at this point in the history
Fixed errcheck with abspath
  • Loading branch information
fatih committed Jan 23, 2016
2 parents 1beac4a + 78175df commit b85b550
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions autoload/go/lint.vim
Original file line number Diff line number Diff line change
Expand Up @@ -159,21 +159,16 @@ function! go#lint#Errcheck(...) abort
echon "vim-go: " | echohl Identifier | echon "errcheck analysing ..." | echohl None
redraw

let command = bin_path . ' ' . goargs
let command = bin_path . ' -abspath ' . goargs
let out = go#tool#ExecuteInDir(command)

if v:shell_error
let errors = []
let mx = '^\(.\{-}\):\(\d\+\):\(\d\+\)\s*\(.*\)'
for line in split(out, '\n')
let tokens = matchlist(line, mx)
if !empty(tokens)
call add(errors, {"filename": expand(go#path#Default() . "/src/" . tokens[1]),
\"lnum": tokens[2],
\"col": tokens[3],
\"text": tokens[4]})
endif
endfor
let errformat = "%f:%l:%c:\ %m, %f:%l:%c\ %#%m"

" Parse and populate our location list
call go#list#ParseFormat(errformat, split(out, "\n"))

let errors = go#list#Get()

if empty(errors)
echohl Error | echomsg "GoErrCheck returned error" | echohl None
Expand Down

0 comments on commit b85b550

Please sign in to comment.