github.com/serversong/goreporter@v0.0.0-20200325104552-3cfaf44fd178/linters/golint/misc/vim/ftplugin/go/lint.vim (about)

     1  " Copyright 2013 The Go Authors. All rights reserved.
     2  " Use of this source code is governed by a BSD-style
     3  " license that can be found in the LICENSE file.
     4  "
     5  " lint.vim: Vim command to lint Go files with golint.
     6  "
     7  "   https://github.com/golang/lint
     8  "
     9  " This filetype plugin add a new commands for go buffers:
    10  "
    11  "   :Lint
    12  "
    13  "       Run golint for the current Go file.
    14  "
    15  if exists("b:did_ftplugin_go_lint")
    16      finish
    17  endif
    18  
    19  if !executable("golint")
    20      finish
    21  endif
    22  
    23  command! -buffer Lint call s:GoLint()
    24  
    25  function! s:GoLint() abort
    26      cexpr system('golint ' . shellescape(expand('%')))
    27  endfunction
    28  
    29  let b:did_ftplugin_go_lint = 1
    30  
    31  " vim:ts=4:sw=4:et