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

make go get -u configurable #883

Merged
merged 1 commit into from
Jun 3, 2016
Merged
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ disabled/enabled easily.

## Install

Master branch is supposed to be a development branch. So stuff here can break and change.
Master branch is supposed to be a development branch. So stuff here can break and change.
Please try use always the [latest release](https://github.com/fatih/vim-go/releases/latest)

Vim-go follows the standard runtime path structure, so I highly recommend to
Expand Down Expand Up @@ -218,6 +218,11 @@ let g:go_bin_path = expand("~/.gotools")
let g:go_bin_path = "/home/fatih/.mypath" "or give absolute path
```

Disable updating dependencies when installing/updating binaries:
```vim
let g:go_get_update = 0
```

### Using with Neovim (beta)

Note: Neovim currently is not a first class citizen for vim-go. You are free
Expand Down
11 changes: 10 additions & 1 deletion doc/vim-go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@ CTRL-t
:GoInstallBinaries

Download and Install all necessary Go tool binaries such as `godef`,
`goimports`, `gocode`, etc.. under `g:go_bin_path`
`goimports`, `gocode`, etc.. under `g:go_bin_path`. Set |g:go_get_update|
to disable updating dependencies.

*:GoUpdateBinaries*
:GoUpdateBinaries
Expand Down Expand Up @@ -1016,6 +1017,14 @@ is used. Use "neosnippet" for neosnippet.vim: >
let g:go_snippet_engine = "ultisnips"
<

*'g:go_get_update'*

Use this option to disable updating dependencies with |GoInstallBinaries|. By
default this is enabled.
>
let g:go_get_update = 1
<

*'g:go_guru_scope'*

Use this option to define the scope of the analysis to be passed for guru
Expand Down
9 changes: 6 additions & 3 deletions plugin/go.vim
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let g:go_loaded_install = 1
" needed by the user with GoInstallBinaries
let s:packages = [
\ "github.com/nsf/gocode",
\ "github.com/alecthomas/gometalinter",
\ "github.com/alecthomas/gometalinter",
\ "golang.org/x/tools/cmd/goimports",
\ "golang.org/x/tools/cmd/guru",
\ "golang.org/x/tools/cmd/gorename",
Expand Down Expand Up @@ -65,13 +65,16 @@ function! s:GoInstallBinaries(updateBinaries)
set noshellslash
endif

let cmd = "go get -u -v "
let cmd = "go get -v "
if get(g:, "go_get_update", 1) != 0
let cmd .= "-u "
endif

let s:go_version = matchstr(go#util#System("go version"), '\d.\d.\d')

" https://github.com/golang/go/issues/10791
if s:go_version > "1.4.0" && s:go_version < "1.5.0"
let cmd .= "-f "
let cmd .= "-f "
endif

for pkg in s:packages
Expand Down