Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed errcheck with abspath #671

Merged
merged 1 commit into from
Jan 23, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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