jimmyfrasche | d3f1281 | 2017-10-05 15:36:01 -0700 | [diff] [blame] | 1 | # Go project directory layout |
jimmyfrasche | d3f1281 | 2017-10-05 15:36:01 -0700 | [diff] [blame] | 2 | |
jimmyfrasche | 4b64714 | 2017-10-05 16:12:10 -0700 | [diff] [blame] | 3 | The Go project itself contains a number of subdirectories. This document will provide a brief overview, but many of these directories have individual README.md or README files that describe their purpose in detail. |
| 4 | |
| 5 | - [api](#api) |
| 6 | - [bin](#bin) |
| 7 | - [blog](#blog) |
| 8 | - [doc](#doc) |
| 9 | - [lib](#lib) |
| 10 | - [misc](#misc) |
jimmyfrasche | 1842d8e | 2017-10-05 16:18:43 -0700 | [diff] [blame] | 11 | - [android](#miscandroid) |
| 12 | - [arm](#miscarm) |
| 13 | - [cgo](#misccgo) |
| 14 | - [chrome](#miscchrome) |
| 15 | - [git](#miscgit) |
| 16 | - [ios](#miscios) |
| 17 | - [linkcheck](#misclinkcheck) |
| 18 | - [nacl](#miscnacl) |
| 19 | - [sortac](#miscsortac) |
| 20 | - [swig](#miscswig) |
| 21 | - [tour](#misctour) |
| 22 | - [trace](#misctrace) |
jimmyfrasche | 4b64714 | 2017-10-05 16:12:10 -0700 | [diff] [blame] | 23 | - [pkg](#pkg) |
jimmyfrasche | 1842d8e | 2017-10-05 16:18:43 -0700 | [diff] [blame] | 24 | - [include](#pkginclude) |
| 25 | - [obj](#pkgobj) |
| 26 | - [tool](#pkgtool) |
jimmyfrasche | 4b64714 | 2017-10-05 16:12:10 -0700 | [diff] [blame] | 27 | - [src](#src) |
| 28 | - [test](#test) |
| 29 | |
| 30 | ## api |
| 31 | |
| 32 | The `api` directory contains machine checkable specifications for the Go standard library, to help enforce the [Go 1 compatibility promise](https://golang.org/doc/go1compat). |
| 33 | |
| 34 | ## bin |
| 35 | |
| 36 | The `bin` directory contains the binaries of the project: `go`, `godoc`, and `gofmt`. |
| 37 | |
| 38 | ## blog |
| 39 | |
| 40 | The `blog` directory contains the source and templates for [the Go blog](https://blog.golang.org/). However, the code for serving the blog is at https://godoc.org/golang.org/x/blog |
| 41 | |
| 42 | ## doc |
| 43 | |
| 44 | The `doc` directory contains the resources served at https://golang.org/doc/ |
| 45 | |
| 46 | ## lib |
| 47 | |
| 48 | The `lib` directory contains a single subdirectory `lib/time` which contains a copy of the time zone database that Go uses if it cannot find the operating systems copy. |
| 49 | |
| 50 | ## misc |
| 51 | |
jimmyfrasche | 1842d8e | 2017-10-05 16:18:43 -0700 | [diff] [blame] | 52 | ### misc/android |
| 53 | |
| 54 | ### misc/arm |
| 55 | |
| 56 | ### misc/cgo |
| 57 | |
jimmyfrasche | ef5e7ea | 2017-10-05 16:42:07 -0700 | [diff] [blame] | 58 | The `misc/cgo` directory contains tests and examples of cgo. |
| 59 | |
jimmyfrasche | 1842d8e | 2017-10-05 16:18:43 -0700 | [diff] [blame] | 60 | ### misc/chrome |
| 61 | |
jimmyfrasche | ef5e7ea | 2017-10-05 16:42:07 -0700 | [diff] [blame] | 62 | The `misc/chrome` directory contains a Chrome extension for Go contributors. |
| 63 | |
jimmyfrasche | 1842d8e | 2017-10-05 16:18:43 -0700 | [diff] [blame] | 64 | ### misc/git |
| 65 | |
jimmyfrasche | ef5e7ea | 2017-10-05 16:42:07 -0700 | [diff] [blame] | 66 | The `misc/git` directory contains a pre-commit hook to ensure that go files have been run through gofmt. |
| 67 | |
jimmyfrasche | 1842d8e | 2017-10-05 16:18:43 -0700 | [diff] [blame] | 68 | ### misc/ios |
| 69 | |
| 70 | ### misc/linkcheck |
| 71 | |
jimmyfrasche | ef5e7ea | 2017-10-05 16:42:07 -0700 | [diff] [blame] | 72 | The `misc/linkcheck` directory contains a program for ensuring there are no missing links in the godoc website. |
| 73 | |
jimmyfrasche | 1842d8e | 2017-10-05 16:18:43 -0700 | [diff] [blame] | 74 | ### misc/nacl |
| 75 | |
jimmyfrasche | ef5e7ea | 2017-10-05 16:42:07 -0700 | [diff] [blame] | 76 | The `misc/nacl` directory contains Go's integration with nacl, which is used by [the Go playground](https://play.golang.org). |
| 77 | |
jimmyfrasche | 1842d8e | 2017-10-05 16:18:43 -0700 | [diff] [blame] | 78 | ### misc/sortac |
| 79 | |
jimmyfrasche | ef5e7ea | 2017-10-05 16:42:07 -0700 | [diff] [blame] | 80 | The `misc/sortac` directory contains a utility for sorting the `AUTHORS` and `CONTRIBUTORS` files. |
| 81 | |
jimmyfrasche | 1842d8e | 2017-10-05 16:18:43 -0700 | [diff] [blame] | 82 | ### misc/swig |
| 83 | |
jimmyfrasche | ef5e7ea | 2017-10-05 16:42:07 -0700 | [diff] [blame] | 84 | The `misc/swig` directory contains examples of using Go with [SWIG](https://github.com/swig/swig). |
| 85 | |
jimmyfrasche | 1842d8e | 2017-10-05 16:18:43 -0700 | [diff] [blame] | 86 | ### misc/tour |
| 87 | |
jimmyfrasche | ef5e7ea | 2017-10-05 16:42:07 -0700 | [diff] [blame] | 88 | The `misc/tour` directory contains the resources and source code for the [Go tour](https://tour.golang.org). |
| 89 | |
jimmyfrasche | 1842d8e | 2017-10-05 16:18:43 -0700 | [diff] [blame] | 90 | ### misc/trace |
| 91 | |
jimmyfrasche | ef5e7ea | 2017-10-05 16:42:07 -0700 | [diff] [blame] | 92 | The `misc/trace` directory contains a generated file used by `go tool trace`. |
| 93 | |
jimmyfrasche | 4b64714 | 2017-10-05 16:12:10 -0700 | [diff] [blame] | 94 | ## pkg |
| 95 | |
jimmyfrasche | ef5e7ea | 2017-10-05 16:42:07 -0700 | [diff] [blame] | 96 | The `pkg` directory contains platform-specific build artifacts. It will always contain the following: |
| 97 | |
jimmyfrasche | 1842d8e | 2017-10-05 16:18:43 -0700 | [diff] [blame] | 98 | ### pkg/include |
| 99 | |
| 100 | ### pkg/obj |
| 101 | |
| 102 | ### pkg/tool |
| 103 | |
jimmyfrasche | ef5e7ea | 2017-10-05 16:42:07 -0700 | [diff] [blame] | 104 | The `pkg/tool` directory contains the platform-specific tool chain exposed by the `go tool` command. |
| 105 | |
jimmyfrasche | 4b64714 | 2017-10-05 16:12:10 -0700 | [diff] [blame] | 106 | ## src |
| 107 | |
| 108 | The `src` directory contains the source code for the standard library and, in `src/cmd`, tool chain. |
| 109 | |
| 110 | ## test |
| 111 | |
| 112 | The `test` directory contains extensive additional tests for the runtime and tool chain. |