diff options
| author | Ethan Lee <ethanalee@google.com> | 2026-02-03 18:25:04 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2026-02-12 09:29:42 -0800 |
| commit | ce44214c045bc223217f4e969a2b2d3f249b7c21 (patch) | |
| tree | 20cd4d689420851b9679d59c44735293cd321782 | |
| parent | 096ce798073111db0a42f945fdd510defda2f6bf (diff) | |
| download | go-x-pkgsite-ce44214c045bc223217f4e969a2b2d3f249b7c21.tar.xz | |
internal/licenses: add COPYING.LESSER to recognized license filenames
Fixes golang/go#77324
Change-Id: I1852deb53b128b0f7f1ebb235287bfced00c2c3c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/741620
Auto-Submit: Ethan Lee <ethanalee@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
kokoro-CI: kokoro <noreply+kokoro@google.com>
| -rw-r--r-- | internal/licenses/licenses.go | 4 | ||||
| -rw-r--r-- | internal/licenses/licenses_test.go | 10 | ||||
| -rw-r--r-- | tests/screentest/testdata/testcases/license-policy-540x1080.want.png | bin | 313426 -> 321065 bytes | |||
| -rw-r--r-- | tests/screentest/testdata/testcases/license-policy.want.png | bin | 339881 -> 347366 bytes |
4 files changed, 10 insertions, 4 deletions
diff --git a/internal/licenses/licenses.go b/internal/licenses/licenses.go index 2a685967..07107edc 100644 --- a/internal/licenses/licenses.go +++ b/internal/licenses/licenses.go @@ -88,6 +88,10 @@ var ( "COPYING.md", "COPYING.markdown", "COPYING.txt", + "COPYING.LESSER", + "COPYING.LESSER.md", + "COPYING.LESSER.markdown", + "COPYING.LESSER.txt", "LICENCE", "LICENCE.md", "LICENCE.markdown", diff --git a/internal/licenses/licenses_test.go b/internal/licenses/licenses_test.go index 9d8e6627..80d79b13 100644 --- a/internal/licenses/licenses_test.go +++ b/internal/licenses/licenses_test.go @@ -341,12 +341,14 @@ func TestPaths(t *testing.T) { "LICENCE": "", "License": "", "COPYING": "", + "COPYING.LESSER": "", "liCeNse": "", "foo/LICENSE": "", "foo/LICENSE.md": "", "foo/LICENCE": "", "foo/License": "", "foo/COPYING": "", + "foo/COPYING.LESSER": "", "foo/license": "", "vendor/pkg/LICENSE": "", // vendored files ignored "pkg/vendor/LICENSE": "", // not a vendored file, but a package named "vendor" @@ -357,22 +359,22 @@ func TestPaths(t *testing.T) { }{ { RootFiles, - []string{"LICENSE", "LICENCE", "License", "COPYING", "LICENSE.md", + []string{"LICENSE", "LICENCE", "License", "COPYING", "COPYING.LESSER", "LICENSE.md", "liCeNse"}, }, { NonRootFiles, []string{ "foo/LICENSE", "foo/LICENSE.md", "foo/LICENCE", "foo/License", - "foo/COPYING", "pkg/vendor/LICENSE", "foo/license", + "foo/COPYING", "foo/COPYING.LESSER", "pkg/vendor/LICENSE", "foo/license", }, }, { AllFiles, []string{ - "LICENSE", "LICENCE", "License", "COPYING", "LICENSE.md", + "LICENSE", "LICENCE", "License", "COPYING", "COPYING.LESSER", "LICENSE.md", "liCeNse", "foo/LICENSE", "foo/LICENSE.md", "foo/LICENCE", "foo/License", - "foo/license", "foo/COPYING", "pkg/vendor/LICENSE", + "foo/license", "foo/COPYING", "foo/COPYING.LESSER", "pkg/vendor/LICENSE", }, }, } { diff --git a/tests/screentest/testdata/testcases/license-policy-540x1080.want.png b/tests/screentest/testdata/testcases/license-policy-540x1080.want.png Binary files differindex 1b0c1b67..77982e54 100644 --- a/tests/screentest/testdata/testcases/license-policy-540x1080.want.png +++ b/tests/screentest/testdata/testcases/license-policy-540x1080.want.png diff --git a/tests/screentest/testdata/testcases/license-policy.want.png b/tests/screentest/testdata/testcases/license-policy.want.png Binary files differindex 49ac6346..1a9ac8c2 100644 --- a/tests/screentest/testdata/testcases/license-policy.want.png +++ b/tests/screentest/testdata/testcases/license-policy.want.png |
