cmd/cloner, cmd/viewer: add _test prefix for files generated with the test build tag

Updates #12736

Signed-off-by: Nick Khyl <nickk@tailscale.com>
This commit is contained in:
Nick Khyl
2024-07-12 14:59:35 -05:00
committed by Nick Khyl
parent 380a3a0834
commit fd0acc4faf
2 changed files with 10 additions and 2 deletions

View File

@ -459,7 +459,11 @@ func main() {
}
genView(buf, it, typ, pkg.Types)
}
out := pkg.Name + "_view.go"
out := pkg.Name + "_view"
if *flagBuildTags == "test" {
out += "_test"
}
out += ".go"
if err := codegen.WritePackageFile("tailscale/cmd/viewer", pkg, out, it, buf); err != nil {
log.Fatal(err)
}