File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ - ` golang.org/x/tool ` :go tool库,强依赖go版本
Original file line number Diff line number Diff line change 1+ - version: 1.21
2+ - toolchain包含go、gofmt命令
3+
4+ - ` go get go@version ` :更新go.mod的go版本且下载Go(一个完整的Go)
5+ - 下载的包:`golang.org/toolchain@v0.0.1-go_VERSION_._GOOS_-_GOARCH_
6+ - 如果 `GOSUMDB=off` ,工具链下载会因为缺少验证而失败。模式 `GOPRIVATE` 和 `GONOSUMDB` 不适用于工具链下载。
7+ - ` go get toolchain@version `
8+ - 会在比go.mod的go更高时,添加指令`toolchain go{version}`(toolchain默认就是go.mod的go),还可能会下载 `golang.org/x/xxxpackage`
9+
10+ - go在运行命令时,如果go.mod声明的go或者toolchain比当前go版本更高时,自动执行` go get go@version ` (可以通过go version确定到底使用了什么版本)
11+
12+ - goenv GOTOOLCHAIN 控制toolchain(覆盖go.mod的go、toolchian),和` go get go@version ` 一样,会下载Go
13+ - 默认`GOTOOLCHAIN=auto`,即使用当前go、go.mod的go、toolchain中版本最高的
14+ - `GOTOOLCHAIN=go{version}` 强制使用这个版本
15+ - `GOTOOLCHAIN=go{version}+auto` 使用这个版本、go.mod的go、toolchain中版本最高的
16+ - GOTOOLCHAIN=auto 等价于 GOTOOLCHAIN=local+auto(local就是所运行的go版本)
17+
18+ - ` go get ` 和 ` go mod tidy ` 命令保持 ` go ` 行大于或等于任何必需依赖模块的 ` go ` 行
19+ - 也就是下载依赖时可能会导致go 行更新
20+ - https://go.dev/doc/toolchain#get
Original file line number Diff line number Diff line change 1+ # package "context" without types was imported
2+
3+ > https://github.com/wailsapp/wails/issues/4060
4+ - 这是因为引用了不正确的 ` golang.org/x/tool ` 库,因为这个库是与Go版本紧密相连的
You can’t perform that action at this time.
0 commit comments