From 84e1b76fda68e8cfb6e8cc62687ebb37ab890723 Mon Sep 17 00:00:00 2001 From: Thomas Roseman Date: Sun, 5 Oct 2025 17:44:39 +0000 Subject: [PATCH] Add test if there is a copyright U+00A9 symbol. This will permit the interchange of "copyright" and the Unicode symbol to be interchanged. --- main.go | 3 ++- main_test.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 9e42e8a..e085bfb 100644 --- a/main.go +++ b/main.go @@ -431,5 +431,6 @@ func hasLicense(b []byte) bool { } return bytes.Contains(bytes.ToLower(b[:n]), []byte("copyright")) || bytes.Contains(bytes.ToLower(b[:n]), []byte("mozilla public")) || - bytes.Contains(bytes.ToLower(b[:n]), []byte("spdx-license-identifier")) + bytes.Contains(bytes.ToLower(b[:n]), []byte("spdx-license-identifier")) || + bytes.Contains(b[:n], []byte("©")) } diff --git a/main_test.go b/main_test.go index 5aa7648..f2c7fa6 100644 --- a/main_test.go +++ b/main_test.go @@ -486,6 +486,7 @@ func TestHasLicense(t *testing.T) { {"Subject to the terms of the Mozilla Public License", true}, {"SPDX-License-Identifier: MIT", true}, {"spdx-license-identifier: MIT", true}, + {"©", true}, } for _, tt := range tests {