summaryrefslogtreecommitdiff
path: root/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/3rf/mongo-lint/misc/vim/ftplugin/go/lint.vim
blob: 7dffd181767c72fba3cb55854cb52d8731989690 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
" Copyright 2013 The Go Authors. All rights reserved.
" Use of this source code is governed by a BSD-style
" license that can be found in the LICENSE file.
"
" lint.vim: Vim command to lint Go files with golint.
"
"   https://github.com/golang/lint
"
" This filetype plugin add a new commands for go buffers:
"
"   :Lint
"
"       Run golint for the current Go file.
"
if exists("b:did_ftplugin_go_lint")
    finish
endif

if !executable("golint")
    finish
endif

command! -buffer Lint call s:GoLint()

function! s:GoLint() abort
    cexpr system('golint ' . shellescape(expand('%')))
endfunction

let b:did_ftplugin_go_lint = 1

" vim:ts=4:sw=4:et