From b0f44d5fb418abaa09d0cea04527bf2cd6807eb3 Mon Sep 17 00:00:00 2001 From: Peter Weinberger Date: Mon, 28 Oct 2024 14:55:05 -0400 Subject: [PATCH] copyright: limit copyright checking to .go files The existing code looked at any file ending 'go' including, for instance, default.pgo. Change-Id: I9a8344d2e23da351ca13a888a367457537e5c1b1 Reviewed-on: https://go-review.googlesource.com/c/tools/+/622895 LUCI-TryBot-Result: Go LUCI Reviewed-by: Robert Findley --- copyright/copyright.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/copyright/copyright.go b/copyright/copyright.go index f5e2de7a4..16bd9d2f3 100644 --- a/copyright/copyright.go +++ b/copyright/copyright.go @@ -52,7 +52,7 @@ license that can be found in the LICENSE file.`) func checkFile(toolsDir, filename string) (bool, error) { // Only check Go files. - if !strings.HasSuffix(filename, "go") { + if !strings.HasSuffix(filename, ".go") { return false, nil } // Don't check testdata files.