LoginSignup
3
5

More than 3 years have passed since last update.

【#Go言語】管理者権限を持たないWindows環境に「Go」と「Visual Studio Code(vscode)」をインストールする #golang #golangjp #vscode #環境構築 #環境設定

Last updated at Posted at 2019-07-22

管理者権限を持たないWindows端末に「Go」と「Visual Studio Code(vscode)」をインストールして開発環境としてセットアップした際の内容を自分用のメモとしてまとめました。

環境情報

OS/ソフトウェア バージョン 入手元
Windows 10 pro バージョン1803(April 2018 Update) Microsoft Corporation
Go 1.12.7 https://golang.org/dl/
Visual Studio Code(vscode) 1.36.1 https://code.visualstudio.com/#alt-downloads

1. Goのインストール

□手順 1-1: 公式URLからZIPファイル版をダウンロードします

■URL
https://golang.org/dl/

■ファイル名
go1.12.7.windows-amd64.zip

□手順 1-2: ZIPファイルを%USERPROFILE\AppData\Local\に展開します

□手順 1-3: コントロールパネルから環境変数を編集を起動します

□手順 1-4: 環境変数GOROOTの値として%USERPROFILE%\AppData\Local\go\を設定します

capture_006_23072019_015506.jpg

□手順 1-5: 環境変数Pathの値に%GOPATH%\bin\を追記しgoコマンドのパスが通っていることを確認します

PS C:> go version
go version go1.12.7 windows/amd64

□手順 1-6: 環境変数GOPATHの値として%USERPROFILE%\gocode\を追記します

capture_007_23072019_015825.jpg

□手順 1-7: スタートメニューからPowerShellを起動し%GOPATH%\srcディレクトリを作成します

PS C:\> New-Item -ItemType Directory -Path $env:GOPATH\src


    ディレクトリ: C:\Users\xxxxxx\gocode


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       YYYY/MM/DD     hh:mm                src

2. Visual Studio Code(vscode)のインストール

□手順 2-1: 公式URLからUser Installerをダウンロードします

■URL
https://code.visualstudio.com/#alt-downloads

■ファイル名
VSCodeUserSetup-x64-1.36.1.exe

□手順 2-2: User Installerを実行します

□手順 2-3: 同意するにチェックをし次へボタンをクリックします

capture_008_23072019_023750.jpg

□手順 2-4: 次へボタンをクリックします

capture_009_23072019_023859.jpg

□手順 2-5: インストールボタンをクリックします

capture_010_23072019_024006.jpg

□手順 2-6: 完了ボタンをクリックします

capture_011_23072019_024122.jpg

□手順 2-7: Visual Studio Code(vscode)の起動を確認します

capture_013_23072019_024835.jpg

3. Visual Studio Code(vscode)のGo拡張機能のインストール

□手順 3-1: 画面左の拡張機能アイコンをクリックしGoという拡張機能を検索しインストールをクリックします

capture_016_23072019_025222.jpg

□手順 3-2: ファイルメニューから新規ファイルを選択します

capture_017_23072019_025405.jpg

□手順 3-3: ファイルメニューから名前をつけて保存を選択します

capture_018_23072019_025549.jpg

□手順 3-4: $GOPATH\srctest.goという名前で保存します

□手順 3-5: 画面右下に通知が表示されるためInstall Allボタンをクリックします

capture_019_23072019_031419.jpg

□手順 3-6: All tools successfully installed. You're ready to Go :).というメッセージが表示されればセットアップ完了です

capture_020_23072019_031807.jpg


以上、管理者権限を持たないWindows端末に「Go」と「Visual Studio Code(vscode)」をインストールして開発環境としてセットアップする手順でした。

3
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
5