menu
書いてる野郎
orebike@gmail.com
Chocolatey を使ってインストールするのが一般的のようだ。
PowerShell(管理者)からドン
> choco install golang Chocolatey v0.10.11 Installing the following packages: golang By installing you accept licenses for the packages. Progress: Downloading golang 1.11.5... 100% golang v1.11.5 [Approved] golang package files install completed. Performing other installation steps. The package golang wants to run 'chocolateyinstall.ps1'. Note: If you don't run this script, the installation will fail. Note: To confirm automatically next time, use '-y' or consider: choco feature enable -n allowGlobalConfirmation Do you want to run the script?([Y]es/[N]o/[P]rint): Y Downloading golang 64 bit from 'https://dl.google.com/go/go1.11.5.windows-amd64.msi' Progress: 100% - Completed download of C:\Users\unko\AppData\Local\Temp\chocolatey\golang\1.11.5\go1.11.5.windows-amd64.msi (110.8 MB). Download of go1.11.5.windows-amd64.msi (110.8 MB) completed. Hashes match. Installing golang... golang has been installed. golang may be able to be automatically uninstalled. Environment Vars (like PATH) have changed. Close/reopen your shell to see the changes (or in powershell/cmd.exe just type `refreshenv`). The install of golang was successful. Software installed as 'msi', install location is likely default. Chocolatey installed 1/1 packages. See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
環境変数を操作しないといかんようなので、編集ツールを入れる
> choco install rapidee
起動する。
これで見ると Go 関係の設定値がいくつかもうすでに設定されていることがわかる。
GOROOT=C:\Go\
GOPATH=%USERPROFILE%\go
Path=%USERPROFILE%\go\bin
USERPROFILE=C:\Users\unko
ってことで、実はもう何もする必要なかったw
普通に使えるようになっている。
> go version go version go1.11.5 windows/amd64
GOPATH に src ディレクトリを作ってそこに自分の HelloWorld ソースを設置する。
このような感じ src/unko.net/helloworld/helloworld.go
あとは Go言語/Hello World のようにやる。
もうパスが通ってるので msys 環境からやったほうが楽かも。