From cc77eb1011eb78432a5e37b874a8bf4dd6a35b68 Mon Sep 17 00:00:00 2001 From: Bhargav Ravuri Date: Wed, 23 Nov 2022 21:40:32 +0530 Subject: [PATCH] scripts: go_srcs_in_module to list go source + test files The shell function go_srcs_in_module will list go test files along with go src files in the specified module. This helps in identifying the copyright header misses in test files. Fixes #14827 Signed-off-by: Bhargav Ravuri --- scripts/test_lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test_lib.sh b/scripts/test_lib.sh index 5a6a06fb8..d1e93ac73 100644 --- a/scripts/test_lib.sh +++ b/scripts/test_lib.sh @@ -108,7 +108,7 @@ function relativePath { # go_srcs_in_module [package] # returns list of all not-generated go sources in the current (dir) module. function go_srcs_in_module { - go list -f "{{with \$c:=.}}{{range \$f:=\$c.GoFiles }}{{\$c.Dir}}/{{\$f}}{{\"\n\"}}{{end}}{{end}}" ./... | grep -vE "(\\.pb\\.go|\\.pb\\.gw.go)" + go list -f "{{with \$c:=.}}{{range \$f:=\$c.GoFiles }}{{\$c.Dir}}/{{\$f}}{{\"\n\"}}{{end}}{{range \$f:=\$c.TestGoFiles }}{{\$c.Dir}}/{{\$f}}{{\"\n\"}}{{end}}{{end}}" ./... | grep -vE "(\\.pb\\.go|\\.pb\\.gw.go)" } # pkgs_in_module [optional:package_pattern]