这篇文章上次修改于 2460 天前,可能其部分内容已经发生变化,如有疑问可询问作者。

参考链接:https://studygolang.com/articles/9602

安装Chocolatey

  1. win+x 选择powershell(管理员权限)
  2. Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

重新打开一个powershell

安装git mingw golang

choco install git 
choco install mingw
choco install golang

运行如下命令

set "GOPATH=C:\GOWORK"

set "Path=C:\GOWORK\bin;%Path%"

setx GOPATH "%GOPATH%"

setx Path "%Path%"

mkdir src\github.com\ethereum

git clone https://github.com/ethereum/go-ethereum src\github.com\ethereum\go-ethereum

cd src\github.com\ethereum\go-ethereum

go get -u -v golang.org/x/net/context

问题解决:

go get -u -v golang.org/x/net/context 报错

mkdir src\golang.org\x

cd src\golang.org\x

git clone git@github.com:golang/net.git --depth 1

编译go-ethereum

cd src\github.com\ethereum\go-ethereum

go install -v ./...

生成文件路径: %GOWORK%/bin

问题解决:

go install -v ./...

报错:
cc1.exe: sorry, unimplemented: 64-bit mode not compiled in

解决: 
配置mingw64/bin到path:
参考:http://www.cnblogs.com/ghj1976/p/3540257.html