Go On windows

## Go vscode 拡張機能

コマンドパレットで

```cmd
Go: Install/Update tools
```

```text
command go.tools.install not found
```

```bash
$ echo %GOPATH%
D:/opt/GoLang/1.16.15/GOPATH
$ echo %GOENV_ROOT%
D:/opt/GoLang/1.16.15/go
```

```bash
go install github.com/ramya-rao-a/go-outline@latest
go install github.com/cweill/gotests/gotests@latest
go install github.com/fatih/gomodifytags@latest
go install github.com/josharian/impl@latest
go install github.com/haya14busa/goplay/cmd/goplay@latest
go install honnef.co/go/tools/cmd/staticcheck@latest
go install golang.org/x/tools/gopls@latest
```

```bash
go install github.com/go-delve/delve/cmd/dlv@latest
D:\opt\GoLang\1.16.15\GOPATH\pkg\mod\honnef.co\go\tools@v0.3.2\go\ir\builder.go:36:2: //go:build comment without // +build comment
exit status 1
```

* .vscode\settings.json

```json
{
    "git.ignoreLimitWarning": true,
    "terminal.integrated.env.windows": {
        "GOPATH": "D:/opt/GoLang/1.16.15/GOPATH",
        "GOENV_ROOT" : "D:/opt/GoLang/1.16.15/go",
        "PATH": "${env:PATH};D:/opt/GoLang/1.16.15/go/bin;D:/opt/GoLang/1.16.15/GOPATH/bin"
    },
    "go.gopath": "D:/opt/GoLang/1.16.15/GOPATH",
}
```

### 色々試したけど portable 版ではダメだったので

* go1.16.15.windows-amd64.msi でインストール

その後、コントロールパネルから環境変数の "GOPATH" を "D:/opt/GoLang/1.16.15/GOPATH" に変えて
「Go: Install/Update tools」を実行したら問題なくインストールされた。。。

```text
Go: Install/Update tools
```

* .vscode\settings.json

```json
{
    "terminal.integrated.env.windows": {
        "GOPATH": "D:/opt/GoLang/1.16.15/GOPATH",
        "GOENV_ROOT" : "D:/opt/GoLang/1.16.15/go",
        "PATH": "${env:PATH};D:/opt/GoLang/1.16.15/go/bin;D:/opt/GoLang/1.16.15/GOPATH/bin"
    },
}
```

* ごれでいけるかも。。。

```json
{
    "terminal.integrated.env.windows": {
        "GOPATH": "D:/opt/GoLang/1.16.15/GOPATH",
        "GOENV_ROOT" : "D:/opt/GoLang/1.16.15/go",
        "PATH": "${env:PATH};D:/opt/GoLang/1.16.15/go/bin;D:/opt/GoLang/1.16.15/GOPATH/bin"
    },
    "go.gopath": "D:/opt/GoLang/1.16.15/GOPATH", 
    "go.goroot": "D:/opt/GoLang/1.16.15/go"
}
```

* .vscode\launch.json

```json
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Package",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "${fileDirname}",
            "env": {},
            "args": [
                "-test.v",
            ]
        }
    ]
}
```

### sample project

[Goのデバッグ環境 on VSCode](https://future-architect.github.io/articles/20201117/)

```bash
mkdir go-sample
cd go-sample
go mod init sample
```

### TODO

[Go言語で開発したWebアプリをローカルサーバーでデバッグする(VSCode)](https://qiita.com/melty_go/items/eca50ac224ec42b85af1)

[Go/Gin/Vue.js/MySQLで超簡単なSPAを開発](https://qiita.com/melty_go/items/1432da74804a9dca112a)

[クリーンアーキテクチャ](https://future-architect.github.io/articles/20200528/#%E3%83%89%E3%83%A1%E3%82%A4%E3%83%B3-%E3%83%AC%E3%82%A4%E3%83%A4%E3%83%BC%EF%BC%9F-or-%E3%83%AC%E3%82%A4%E3%83%A4%E3%83%BC-%E3%83%89%E3%83%A1%E3%82%A4%E3%83%B3%EF%BC%9F-or-%E3%83%89%E3%83%A1%E3%82%A4%E3%83%B3%EF%BC%9F-or-%E3%83%AC%E3%82%A4%E3%83%A4%E3%83%BC%EF%BC%9F)

[Standard Go Project Layout](https://github.com/golang-standards/project-layout/blob/master/README_ja.md#standard-go-project-layout)

[go言語でクリーンアーキテクチャっぽいもの](https://eng-blog.iij.ad.jp/archives/2442)

[.envを使って環境変数を読み込む(godotenv) ](https://zenn.dev/a_ichi1/articles/c9f3870350c5e2)

[Golangの設計思想](https://zenn.dev/kenghaya/articles/1b88417b1fa44d)

[【Go】net/httpでGetしたjsonのResponseを見る](https://zenn.dev/yoji/articles/39d00b851af9d3)

*20220706追加*

[[Go] map[string]interface{}とJSON string間の変換](https://noknow.info/it/go/how_to_convert_between_map_string_interface_and_json_string?lang=ja)

[Convert Map to JSON in Go](https://www.tutorialkart.com/golang-tutorial/golang-convert-map-to-json/)