Skip to content

Commit

Permalink
use go doc instead of godoc
Browse files Browse the repository at this point in the history
`godoc`'s CLI support is deprecated and expected to be removed in Go
1.12; `go doc` is the future; adopt it now.

Fixes #2069
  • Loading branch information
bhcleek committed Nov 22, 2018
1 parent 0ff2a64 commit 1d23f77
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
4 changes: 0 additions & 4 deletions autoload/go/config.vim
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,6 @@ function! go#config#DeclsMode() abort
return get(g:, "go_decls_mode", "")
endfunction

function! go#config#DocCommand() abort
return get(g:, "go_doc_command", ["godoc"])
endfunction

function! go#config#FmtCommand() abort
return get(g:, "go_fmt_command", "gofmt")
endfunction
Expand Down
5 changes: 2 additions & 3 deletions autoload/go/doc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ function! go#doc#Open(newmode, mode, ...) abort
return
endif

let [l:out, l:err] = go#util#Exec(go#config#DocCommand() + a:000)
" Without argument: run gogetdoc on cursor position.
else
let [l:out, l:err] = go#util#Exec(['go', 'doc'] + a:000)
else " Without argument: run gogetdoc on cursor position.
let [l:out, l:err] = s:gogetdoc(0)
if out == -1
return
Expand Down
8 changes: 0 additions & 8 deletions doc/vim-go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1363,14 +1363,6 @@ Use this option to jump to an existing buffer for the split, vsplit and tab
mappings of |:GoDef|. By default it's disabled. >
let g:go_def_reuse_buffer = 0
<
*'g:go_doc_command'*

Command to use for |:GoDoc|; only used when invoked with a package name. The
`gogetdoc` command is always used when |:GoDoc| is used on the identifier
under the cursor (i.e. without argument or from |K|). >
let g:go_doc_command = ["godoc"]
<
*'g:go_bin_path'*

Expand Down

0 comments on commit 1d23f77

Please sign in to comment.