> For the complete documentation index, see [llms.txt](https://denglj.gitbook.io/essential-go/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://denglj.gitbook.io/essential-go/01-getting-started/windows-install-and-setup.md).

# Windows安装和设置

## 安装

从 <https://golang.org/dl/> 下载 `.msi`安装包后执行安装即可。

## 设置

安装好编译器后，会自动设置`GOPATH`环境变量。

自从Go 1.8起，`GOPATH`默认为`%USERPROFILE%/go`目录，可修改。

您应该了解[`GOPATH`对go工具的影响](/essential-go/01-getting-started/gopath-goroot-gobin.md)。

{% hint style="success" %}

#### 阿驹补遗

可以打开 Cmd 或 Powershell 终端，执行`go env`命令，以查看Go编译器支持的环境变量。一般的，还需要注意的环境变量为：

* `GOBIN` ，go get 和 go install 安装可执行文件的位置
* `GOROOT`，go编译器安装的根目录
* `GOPROXY`，go包下载代理，国内用户可设为 <https://goproxy.cn,direct>
  {% endhint %}
