Drop regeneration directives from copied code.

This commit is contained in:
monopole
2021-02-26 14:34:22 -08:00
parent c9d9348944
commit bbebd1e56a
4 changed files with 3 additions and 6 deletions

View File

@@ -92,10 +92,11 @@ func (c Copier) CopyFile(dir, name string) error {
for scanner.Scan() {
l := scanner.Text()
// Disallow recursive generation.
if strings.HasPrefix(l, "//go:generate") {
if strings.HasPrefix(l, "//go:generate") ||
strings.HasPrefix(l, "// +k8s:") {
continue
}
// Don't want it to appear double generated.
// When copying generated code, drop the old 'generated' message.
if strings.HasPrefix(l, "// Code generated") {
continue
}