Install Go language and display hello world (Go言語のインストールとhello worldの表示)

Install GO language on Windows 10.

Windows 10にGO言語をインストールします。

I installed GO language by referring to the following site.

私は下記のサイトを参考にしてGO言語をインストールしました。

There are three ways to install the GO language on Windows.

WindowsにはGO言語をインストールする方法が3つあります。

私はChocolateyを使用しました。

I used Chocolatey.

Step 1: Install Chocolatey

ステップ 1:Chocolateyのインストール

Step 1-1: Open the command prompt and execute the following command

ステップ 1-1: コマンドプロンプトを開き、下記のコマンドを実行する


[@”%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe” -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command ” [System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString(‘https://chocolatey.org/install.ps1’))” && SET “PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin”]


(Please execute the command prompt with administrator privileges.)

(コマンドプロンプトは管理者権限で実行してください。)

※The commands are at Install with cmd.exe in the Chocolatey documentation.

※コマンドはChocolateyのドキュメントにあるInstall with cmd.exeに書かれています。

Step2 :Go language installation

ステップ2:Go言語のインストール

Step 2-1: Open the command prompt and execute the following command

ステップ 2-1: コマンドプロンプトを開き、下記のコマンドを実行する

[choco install golang]

(Please execute the command prompt with administrator privileges.)

(コマンドプロンプトは管理者権限で実行してください。)

Step 3:Register GOPATH / bin in PATH

ステップ3:PATHにGOPATH/binを登録する

Step 3-1:Add the following path to the edit of the environment variable name

ステップ3-1:環境変数名の編集に下記のパスを新規追加する

[%GOPATH%\bin]

Step 4:Check the version of GO language

ステップ 4:GO言語のバージョンを確認する

Step 4-1:Restart command prompt

ステップ 4-1:コマンドプロンプトを再起動する

Step 4-1:Execute the following command

ステップ 4-1:下記のコマンドを実行する

[go version]

Step 4-2:It is correct if the command prompt result is as follows

ステップ 4-2:コマンドプロンプトの結果が下記だと正しい

[go version go1.10.2 windows/amd64]

Step 5:Check the version of GO language

ステップ 5:Go言語の標準的なパッケージマネージャdepコマンドのインストール

Step 5-1:Execute the following command

ステップ 5-1:下記のコマンドを実行する

[go get -u github.com/golang/dep/cmd/dep]

Step 5-2:Confirm the installation with the following command

ステップ 5-2:下記のコマンドでインストールを確認する

[dep version]

Step 5-3:It is correct if the command prompt result is as follows

ステップ 5-3:コマンドプロンプトの結果が下記だと正しい

[ dep: version : devel build date : git hash : go version : go1.10.3 go compiler : gc platform : windows/amd64 features : ImportDuringSolve=false ]

※If git is not installed, install it from below

※gitがインストールされていない場合は、下記からインストールする

https://git-scm.com/downloads

Step 6:Create an appropriate folder

ステップ 6:適当なフォルダを作成する

Step 6-1:Create an appropriate file

ステップ 6-1:適当なファイルを作成する

Step 6-1:Write the following code in the file

ステップ 6-1:ファイルに下記のコード書く

[ package main import “fmt” func main(){ fmt.Println(“hello world”) } ]

Step 6-2:Go to the folder from the command prompt and execute the file

ステップ 6-2:コマンドプロンプトからフォルダに移動して、下記のコマンドでファイルを実行する

Step 6-3:Go to the folder from the command prompt and execute the file with the following command

ステップ 6-3:コマンドプロンプトからフォルダに移動してファイルを実行する

Step 6-4:It is correct if the command prompt result is as follows

ステップ 6-4:コマンドプロンプトの結果が下記だと正しい

[Hello world]

カテゴリー: programming パーマリンク

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です