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 <bhargav.ravuri@infracloud.io>
This commit is contained in:
parent
51c0b4dff3
commit
cc77eb1011
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user