2017-03-25 31 views
1

Go in VSCodeを使用しようとしています。 GitとGitをインストールして、コードにプロジェクトを作成しました。ファイルは.goです。VSコードでGoツールをインストールできない

何か入力すると、VSCodeはgolintのようなツールが見つからないと警告し、インストールするように促します。 「すべてインストール」をクリックします。

するとコンソールはこのことを示しています

Installing 10 tools 
    gocode 
    gopkgs 
    go-outline 
    go-symbols 
    guru 
    gorename 
    godef 
    goreturns 
    golint 
    gotests 

Installing gocode SUCCEEDED 
Installing gopkgs SUCCEEDED 
Installing go-outline SUCCEEDED 
Installing go-symbols FAILED 
Installing guru FAILED 
Installing gorename FAILED 
Installing godef SUCCEEDED 
Installing goreturns FAILED 
Installing golint FAILED 
Installing gotests FAILED 

6 tools failed to install. 

go-symbols: 
Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/newhook/go-symbols 
github.com/newhook/go-symbols (download) 
Fetching https://golang.org/x/tools/go/buildutil?go-get=1 
Parsing meta tags from https://golang.org/x/tools/go/buildutil?go-get=1 (status code 200) 
get "golang.org/x/tools/go/buildutil": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/go/buildutil?go-get=1 
get "golang.org/x/tools/go/buildutil": verifying non-authoritative meta tag 
Fetching https://golang.org/x/tools?go-get=1 
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) 
golang.org/x/tools (download) 
# cd C:\Users\user\go\src\golang.org\x\tools; git pull --ff-only 
fatal: Not a git repository (or any of the parent directories): .git 
package golang.org/x/tools/go/buildutil: exit status 128 
github.com/newhook/go-symbols (download) 
Fetching https://golang.org/x/tools/go/buildutil?go-get=1 
Parsing meta tags from https://golang.org/x/tools/go/buildutil?go-get=1 (status code 200) 
get "golang.org/x/tools/go/buildutil": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/go/buildutil?go-get=1 
get "golang.org/x/tools/go/buildutil": verifying non-authoritative meta tag 
Fetching https://golang.org/x/tools?go-get=1 
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) 
golang.org/x/tools (download) 
# cd C:\Users\user\go\src\golang.org\x\tools; git pull --ff-only 
fatal: Not a git repository (or any of the parent directories): .git 
package golang.org/x/tools/go/buildutil: exit status 128 

guru: 
Error: Command failed: C:\Go\bin\go.exe get -u -v golang.org/x/tools/cmd/guru 
Fetching https://golang.org/x/tools/cmd/guru?go-get=1 
Parsing meta tags from https://golang.org/x/tools/cmd/guru?go-get=1 (status code 200) 
get "golang.org/x/tools/cmd/guru": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/cmd/guru?go-get=1 
get "golang.org/x/tools/cmd/guru": verifying non-authoritative meta tag 
Fetching https://golang.org/x/tools?go-get=1 
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) 
golang.org/x/tools (download) 
# cd C:\Users\user\go\src\golang.org\x\tools; git pull --ff-only 
fatal: Not a git repository (or any of the parent directories): .git 
package golang.org/x/tools/cmd/guru: exit status 128 
Fetching https://golang.org/x/tools/cmd/guru?go-get=1 
Parsing meta tags from https://golang.org/x/tools/cmd/guru?go-get=1 (status code 200) 
get "golang.org/x/tools/cmd/guru": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/cmd/guru?go-get=1 
get "golang.org/x/tools/cmd/guru": verifying non-authoritative meta tag 
Fetching https://golang.org/x/tools?go-get=1 
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) 
golang.org/x/tools (download) 
# cd C:\Users\user\go\src\golang.org\x\tools; git pull --ff-only 
fatal: Not a git repository (or any of the parent directories): .git 
package golang.org/x/tools/cmd/guru: exit status 128 

gorename: 
Error: Command failed: C:\Go\bin\go.exe get -u -v golang.org/x/tools/cmd/gorename 
Fetching https://golang.org/x/tools/cmd/gorename?go-get=1 
Parsing meta tags from https://golang.org/x/tools/cmd/gorename?go-get=1 (status code 200) 
get "golang.org/x/tools/cmd/gorename": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/cmd/gorename?go-get=1 
get "golang.org/x/tools/cmd/gorename": verifying non-authoritative meta tag 
Fetching https://golang.org/x/tools?go-get=1 
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) 
golang.org/x/tools (download) 
# cd C:\Users\user\go\src\golang.org\x\tools; git pull --ff-only 
fatal: Not a git repository (or any of the parent directories): .git 
package golang.org/x/tools/cmd/gorename: exit status 128 
Fetching https://golang.org/x/tools/cmd/gorename?go-get=1 
Parsing meta tags from https://golang.org/x/tools/cmd/gorename?go-get=1 (status code 200) 
get "golang.org/x/tools/cmd/gorename": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/cmd/gorename?go-get=1 
get "golang.org/x/tools/cmd/gorename": verifying non-authoritative meta tag 
Fetching https://golang.org/x/tools?go-get=1 
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) 
golang.org/x/tools (download) 
# cd C:\Users\user\go\src\golang.org\x\tools; git pull --ff-only 
fatal: Not a git repository (or any of the parent directories): .git 
package golang.org/x/tools/cmd/gorename: exit status 128 

goreturns: 
Error: Command failed: C:\Go\bin\go.exe get -u -v sourcegraph.com/sqs/goreturns 
Fetching https://sourcegraph.com/sqs/goreturns?go-get=1 
Parsing meta tags from https://sourcegraph.com/sqs/goreturns?go-get=1 (status code 200) 
get "sourcegraph.com/sqs/goreturns": found meta tag main.metaImport{Prefix:"sourcegraph.com/sqs/goreturns", VCS:"git", RepoRoot:"https://github.com/sqs/goreturns"} at https://sourcegraph.com/sqs/goreturns?go-get=1 
sourcegraph.com/sqs/goreturns (download) 
github.com/sqs/goreturns (download) 
Fetching https://golang.org/x/tools/imports?go-get=1 
Parsing meta tags from https://golang.org/x/tools/imports?go-get=1 (status code 200) 
get "golang.org/x/tools/imports": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/imports?go-get=1 
get "golang.org/x/tools/imports": verifying non-authoritative meta tag 
Fetching https://golang.org/x/tools?go-get=1 
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) 
golang.org/x/tools (download) 
# cd C:\Users\user\go\src\golang.org\x\tools; git pull --ff-only 
fatal: Not a git repository (or any of the parent directories): .git 
package golang.org/x/tools/imports: exit status 128 
Fetching https://sourcegraph.com/sqs/goreturns?go-get=1 
Parsing meta tags from https://sourcegraph.com/sqs/goreturns?go-get=1 (status code 200) 
get "sourcegraph.com/sqs/goreturns": found meta tag main.metaImport{Prefix:"sourcegraph.com/sqs/goreturns", VCS:"git", RepoRoot:"https://github.com/sqs/goreturns"} at https://sourcegraph.com/sqs/goreturns?go-get=1 
sourcegraph.com/sqs/goreturns (download) 
github.com/sqs/goreturns (download) 
Fetching https://golang.org/x/tools/imports?go-get=1 
Parsing meta tags from https://golang.org/x/tools/imports?go-get=1 (status code 200) 
get "golang.org/x/tools/imports": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/imports?go-get=1 
get "golang.org/x/tools/imports": verifying non-authoritative meta tag 
Fetching https://golang.org/x/tools?go-get=1 
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) 
golang.org/x/tools (download) 
# cd C:\Users\user\go\src\golang.org\x\tools; git pull --ff-only 
fatal: Not a git repository (or any of the parent directories): .git 
package golang.org/x/tools/imports: exit status 128 

golint: 
Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/golang/lint/golint 
github.com/golang/lint (download) 
Fetching https://golang.org/x/tools/go/gcexportdata?go-get=1 
Parsing meta tags from https://golang.org/x/tools/go/gcexportdata?go-get=1 (status code 200) 
get "golang.org/x/tools/go/gcexportdata": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/go/gcexportdata?go-get=1 
get "golang.org/x/tools/go/gcexportdata": verifying non-authoritative meta tag 
Fetching https://golang.org/x/tools?go-get=1 
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) 
golang.org/x/tools (download) 
# cd C:\Users\user\go\src\golang.org\x\tools; git pull --ff-only 
fatal: Not a git repository (or any of the parent directories): .git 
package golang.org/x/tools/go/gcexportdata: exit status 128 
github.com/golang/lint (download) 
Fetching https://golang.org/x/tools/go/gcexportdata?go-get=1 
Parsing meta tags from https://golang.org/x/tools/go/gcexportdata?go-get=1 (status code 200) 
get "golang.org/x/tools/go/gcexportdata": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/go/gcexportdata?go-get=1 
get "golang.org/x/tools/go/gcexportdata": verifying non-authoritative meta tag 
Fetching https://golang.org/x/tools?go-get=1 
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) 
golang.org/x/tools (download) 
# cd C:\Users\user\go\src\golang.org\x\tools; git pull --ff-only 
fatal: Not a git repository (or any of the parent directories): .git 
package golang.org/x/tools/go/gcexportdata: exit status 128 

gotests: 
Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/cweill/gotests/... 
github.com/cweill/gotests (download) 
Fetching https://golang.org/x/tools/imports?go-get=1 
Parsing meta tags from https://golang.org/x/tools/imports?go-get=1 (status code 200) 
get "golang.org/x/tools/imports": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/imports?go-get=1 
get "golang.org/x/tools/imports": verifying non-authoritative meta tag 
Fetching https://golang.org/x/tools?go-get=1 
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) 
golang.org/x/tools (download) 
# cd C:\Users\user\go\src\golang.org\x\tools; git pull --ff-only 
fatal: Not a git repository (or any of the parent directories): .git 
package golang.org/x/tools/imports: exit status 128 
github.com/cweill/gotests (download) 
Fetching https://golang.org/x/tools/imports?go-get=1 
Parsing meta tags from https://golang.org/x/tools/imports?go-get=1 (status code 200) 
get "golang.org/x/tools/imports": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/imports?go-get=1 
get "golang.org/x/tools/imports": verifying non-authoritative meta tag 
Fetching https://golang.org/x/tools?go-get=1 
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) 
golang.org/x/tools (download) 
# cd C:\Users\user\go\src\golang.org\x\tools; git pull --ff-only 
fatal: Not a git repository (or any of the parent directories): .git 
package golang.org/x/tools/imports: exit status 128 

いくつかのツールをインストールすることができ、他の人はそうではありません。 Not a git repositoryエラーについては何もできません。自動化されたプロセスであり、gitコマンドを入力するのではないからです。

PowerShellでツールを個別にインストールしようとしましたが、同じエラーが発生します。私のgoディレクトリが作成され(%USERPROFILE%\go)、GOPATHが正しく設定されています。

アイデア?

答えて

2

C:\Users\user\go\src\golang.org\x\toolsがgit repoではないと不平を言っているようですので、その中にあるものは更新できません。

自分のコードをそのディレクトリに配置しなかったと仮定して、そのディレクトリを削除してから再度実行してください。

Goプラグインのドキュメントを見て、一番下までスクロールすると、プラグインに必要なものを手動でインストール/アップグレードする場合に実行するコマンドが表示されます。

具体的には、their github repoから取得すると、cmd.exeプロンプトから実行できます。

go get -u -v github.com/nsf/gocode 
go get -u -v github.com/rogpeppe/godef 
go get -u -v github.com/zmb3/gogetdoc 
go get -u -v github.com/golang/lint/golint 
go get -u -v github.com/lukehoban/go-outline 
go get -u -v sourcegraph.com/sqs/goreturns 
go get -u -v golang.org/x/tools/cmd/gorename 
go get -u -v github.com/tpng/gopkgs 
go get -u -v github.com/newhook/go-symbols 
go get -u -v golang.org/x/tools/cmd/guru 
go get -u -v github.com/cweill/gotests/... 
go get -u -v golang.org/x/tools/cmd/godoc 
go get -u -v github.com/fatih/gomodifytags 
+0

自分自身のプロジェクトではなかった '%GOPATH%\ *'ディレクトリのすべてを削除し、VSCodeを再起動して「すべてインストール」を要求し、インストールは問題なく行われます。ありがとうございました。 – Arno

関連する問題