Go Wiki:FileTreeDocumentation
此頁面記載 go1.13.1 原始碼安裝的檔案樹狀結構。
$ tree -d -L 2 /usr/lib/go1.13.1 | head
/usr/lib/go1.13.1
`-- go
|-- api
|-- bin
|-- doc
|-- lib
|-- misc
|-- pkg
|-- src
`-- test
$
api 包含 Go API 檢查器的資料
$ ls $GOROOT/api
README go1.10.txt go1.13.txt go1.4.txt go1.7.txt go1.txt
except.txt go1.11.txt go1.2.txt go1.5.txt go1.8.txt next.txt
go1.1.txt go1.12.txt go1.3.txt go1.6.txt go1.9.txt
$
bin 包含 go 和 gofmt 執行檔
$ ls -l $GOROOT/bin
total 11576
-rwxr-xr-x 1 root root 9652760 Oct 2 03:02 go
-rwxr-xr-x 1 root root 2197756 Oct 2 03:02 gofmt
$
doc 包含 .css、.go、.html、.js 和 .png 檔案
lib 包含壓縮時區資料庫
$ tree $GOROOT/lib | head -n 5
/usr/lib/go1.13.1/go/lib
`-- time
|-- README
|-- update.bash
`-- zoneinfo.zip
$
misc 包含與特定建置模式和平台相關的檔案
$ tree -d -L 1 $GOROOT/misc | head -n 12
/usr/lib/go1.13.1/go/misc
|-- android
|-- arm
|-- cgo
|-- chrome
|-- ios
|-- linkcheck
|-- nacl
|-- reboot
|-- swig
|-- trace
`-- wasm
$
pkg 包含函式庫、標頭檔、已編譯的物件檔和執行檔
$ tree -d -L 1 $GOROOT/pkg | head -n 6
/usr/lib/go1.13.1/go/pkg
|-- include
|-- linux_386
|-- linux_386_dynlink
|-- obj
`-- tool
$
src 包含 go1.13.1 原始碼
test 包含 Go 工具鏈和執行時期的測試
此內容是 Go Wiki 的一部分。