@@ -2893,6 +2893,28 @@ the `.zip` file are [authenticated](#authenticating) before extraction into the
2893
2893
module cache the same way they would be if the ` .zip ` file were downloaded from
2894
2894
a proxy.
2895
2895
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
+
2896
2918
### Controlling version control tools with ` GOVCS ` {#vcs-govcs}
2897
2919
2898
2920
The ` go ` command's ability to download modules with version control commands
0 commit comments