You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu下通过官方归档安装Go后vim-go插件无法正常工作

Fixing vim-go's "gotags not found" and golint Installation Issues

Hey there, let's tackle this vim-go problem you're facing—those missing tool errors are super common when setting up Go with Vim, so we'll get it sorted out quickly!

First: Verify Your Go Environment Variables

The root cause often boils down to incorrect Go path configuration, which prevents vim-go from finding (or installing) the required binaries. Let's check and fix that first:

  1. Open your shell's config file (like ~/.bashrc, ~/.zshrc, or ~/.profile) in a text editor.
  2. Add these lines if they're missing (adjust GOPATH to your preferred directory if needed):
    export GOPATH=$HOME/go
    export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
    
  3. Save the file and reload the config with:
    source ~/.bashrc  # or the file you edited
    
  4. Confirm the paths are set correctly by running:
    echo $GOPATH
    echo $PATH | grep -E "(go/bin|/usr/local/go/bin)"
    
    You should see both paths in the output.

Manually Install Missing Tools

Sometimes :GoInstallBinaries fails due to network issues or outdated repo paths. Let's install the problematic tools directly:

1. Install gotags

Run this command in your terminal (this pulls the official, up-to-date gotags repo):

go get github.com/jstemmer/gotags

2. Install golint

The golint repo has moved over time, so use the correct path:

go get golang.org/x/lint/golint

If you hit network errors (like being unable to reach golang.org), set a Go proxy first:

export GOPROXY=https://goproxy.io,direct
go get golang.org/x/lint/golint

Final Step: Run :GoInstallBinaries Again

Once the above tools are installed, open Vim again and run:

:GoInstallBinaries

This should now install any remaining vim-go dependencies without errors.

Bonus: Update vim-go

Make sure your vim-go plugin is up to date. If you're using a plugin manager like vim-plug, run:

:PlugUpdate vim-go

Or use the update command for your specific manager (Vundle, Pathogen, etc.).

内容的提问来源于stack exchange,提问作者v v

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 07:54:58