Golang import path `all`

go help packages 可以看到三個 reserved names 如下:

1
2
3
4
5
6
7
8
- "main" denotes the top-level package in a stand-alone executable.

- "all" expands to all package directories found in all the GOPATH
trees. For example, 'go list all' lists all the packages on the local
system.

- "std" is like all but expands to just the packages in the standard
Go library.

實際使用起來有如下的一些可能,不過最好用 root 裝 go,免得影響到 std libraries.

  1. 更新全部 go get -u all
  2. 清掉全部 build 出的 libraries go clean -i all
  3. install 全部 go install all