diff options
| author | Jay Conrod <jayconrod@google.com> | 2021-08-05 10:45:34 -0700 |
|---|---|---|
| committer | Jay Conrod <jayconrod@google.com> | 2021-08-05 20:30:57 +0000 |
| commit | 0c3ebd1d7c083b4231728aff95728f628d048707 (patch) | |
| tree | 57b3ad408dcf2e1a4d9cd5f71518590326f60830 /_content/ref | |
| parent | 8bf2ffb05d028b8ee43c865a98cb20e7324202ea (diff) | |
| download | go-x-website-0c3ebd1d7c083b4231728aff95728f628d048707.tar.xz | |
_content/ref/mod: document special case for LICENSE
Change-Id: Ie15dc10304d430d1fb3201931fc5c161581f79ea
Reviewed-on: https://go-review.googlesource.com/c/website/+/340209
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Daniel Martà <mvdan@mvdan.cc>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to '_content/ref')
| -rw-r--r-- | _content/ref/mod.md | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/_content/ref/mod.md b/_content/ref/mod.md index aa896135..ddcd7f3d 100644 --- a/_content/ref/mod.md +++ b/_content/ref/mod.md @@ -2893,6 +2893,28 @@ the `.zip` file are [authenticated](#authenticating) before extraction into the module cache the same way they would be if the `.zip` file were downloaded from a proxy. +### Special case for LICENSE files {#vcs-license} + +When the `go` command creates a `.zip` file for a module that is not in the +repository root directory, if the module does not have a file named `LICENSE` +in its root directory (alongside `go.mod`), the `go` command will copy the +file named `LICENSE` from the repository root directory if it is present in +the same revision. + +This special case allows the same `LICENSE` file to apply to all modules within +a repository. This only applies to files named `LICENSE` specifically, without +extensions like `.txt`. Unfortunately, this cannot be extended without breaking +cryptographic sums of exesting modules; see [Authenticating +modules](#authenticating). Other tools and websites like +[pkg.go.dev](https://pkg.go.dev) may recognize files with other names. + +Note also that the `go` command does not include symbolic links when creating +module `.zip` files; see [File path and size +constraints](#zip-path-size-constraints). Consequently, if a repository does not +have a `LICENSE` file in its root directory, authors may instead create copies +of their license files in modules defined in subdirectories to ensure those +files are included in module `.zip` files. + ### Controlling version control tools with `GOVCS` {#vcs-govcs} The `go` command's ability to download modules with version control commands |
