cmd/cloner: reduce diff noise when changing command

Spelling out the command to run for every type
means that changing the command makes for a large, repetitive diff.
Stop doing that.

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:
Josh Bleecher Snyder
2021-09-15 10:05:34 -07:00
committed by Josh Bleecher Snyder
parent 865d8c0d23
commit 4bbf5a8636
7 changed files with 31 additions and 41 deletions

View File

@@ -149,7 +149,8 @@ const header = `// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserve
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated by tailscale.com/cmd/cloner -type %s; DO NOT EDIT.
// Code generated by the following command; DO NOT EDIT.
// tailscale.com/cmd/cloner -type %s
package %s
@@ -178,8 +179,7 @@ func gen(buf *bytes.Buffer, imports map[string]struct{}, name string, typ *types
writeRegen := func(format string, args ...interface{}) {
fmt.Fprintf(regenBuf, format+"\n", args...)
}
writeRegen("// A compilation failure here means this code must be regenerated, with command:")
writeRegen("// tailscale.com/cmd/cloner -type %s", *flagTypes)
writeRegen("// A compilation failure here means this code must be regenerated, with the command at the top of this file.")
writeRegen("var _%sNeedsRegeneration = %s(struct {", name, name)
name := typ.Obj().Name()