Skip to content

Commit 0c3ebd1

Browse files
author
Jay Conrod
committed
_content/ref/mod: document special case for LICENSE
Change-Id: Ie15dc10304d430d1fb3201931fc5c161581f79ea Reviewed-on: https://go-review.googlesource.com/c/website/+/340209 Trust: Jay Conrod <[email protected]> Run-TryBot: Jay Conrod <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Daniel Martí <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
1 parent 8bf2ffb commit 0c3ebd1

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

_content/ref/mod.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2893,6 +2893,28 @@ the `.zip` file are [authenticated](#authenticating) before extraction into the
28932893
module cache the same way they would be if the `.zip` file were downloaded from
28942894
a proxy.
28952895

2896+
### Special case for LICENSE files {#vcs-license}
2897+
2898+
When the `go` command creates a `.zip` file for a module that is not in the
2899+
repository root directory, if the module does not have a file named `LICENSE`
2900+
in its root directory (alongside `go.mod`), the `go` command will copy the
2901+
file named `LICENSE` from the repository root directory if it is present in
2902+
the same revision.
2903+
2904+
This special case allows the same `LICENSE` file to apply to all modules within
2905+
a repository. This only applies to files named `LICENSE` specifically, without
2906+
extensions like `.txt`. Unfortunately, this cannot be extended without breaking
2907+
cryptographic sums of exesting modules; see [Authenticating
2908+
modules](#authenticating). Other tools and websites like
2909+
[pkg.go.dev](https://pkg.go.dev) may recognize files with other names.
2910+
2911+
Note also that the `go` command does not include symbolic links when creating
2912+
module `.zip` files; see [File path and size
2913+
constraints](#zip-path-size-constraints). Consequently, if a repository does not
2914+
have a `LICENSE` file in its root directory, authors may instead create copies
2915+
of their license files in modules defined in subdirectories to ensure those
2916+
files are included in module `.zip` files.
2917+
28962918
### Controlling version control tools with `GOVCS` {#vcs-govcs}
28972919

28982920
The `go` command's ability to download modules with version control commands

0 commit comments

Comments
 (0)