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>
pull/2863/head
Josh Bleecher Snyder 3 years ago committed by Josh Bleecher Snyder
parent 865d8c0d23
commit 4bbf5a8636

@ -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()

@ -2,7 +2,8 @@
// 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 Prefs; DO NOT EDIT.
// Code generated by the following command; DO NOT EDIT.
// tailscale.com/cmd/cloner -type Prefs
package ipn
@ -30,8 +31,7 @@ func (src *Prefs) Clone() *Prefs {
return dst
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type Prefs
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
var _PrefsNeedsRegeneration = Prefs(struct {
ControlURL string
RouteAll bool

@ -2,7 +2,8 @@
// 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 User,Node,Hostinfo,NetInfo,Login,DNSConfig,RegisterResponse,DERPRegion,DERPMap,DERPNode; DO NOT EDIT.
// Code generated by the following command; DO NOT EDIT.
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig,RegisterResponse,DERPRegion,DERPMap,DERPNode
package tailcfg
@ -27,8 +28,7 @@ func (src *User) Clone() *User {
return dst
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig,RegisterResponse,DERPRegion,DERPMap,DERPNode
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
var _UserNeedsRegeneration = User(struct {
ID UserID
LoginName string
@ -64,8 +64,7 @@ func (src *Node) Clone() *Node {
return dst
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig,RegisterResponse,DERPRegion,DERPMap,DERPNode
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
var _NodeNeedsRegeneration = Node(struct {
ID NodeID
StableID StableNodeID
@ -108,8 +107,7 @@ func (src *Hostinfo) Clone() *Hostinfo {
return dst
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig,RegisterResponse,DERPRegion,DERPMap,DERPNode
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
var _HostinfoNeedsRegeneration = Hostinfo(struct {
IPNVersion string
FrontendLogID string
@ -145,8 +143,7 @@ func (src *NetInfo) Clone() *NetInfo {
return dst
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig,RegisterResponse,DERPRegion,DERPMap,DERPNode
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
var _NetInfoNeedsRegeneration = NetInfo(struct {
MappingVariesByDestIP opt.Bool
HairPinning opt.Bool
@ -172,8 +169,7 @@ func (src *Login) Clone() *Login {
return dst
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig,RegisterResponse,DERPRegion,DERPMap,DERPNode
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
var _LoginNeedsRegeneration = Login(struct {
_ structs.Incomparable
ID LoginID
@ -213,8 +209,7 @@ func (src *DNSConfig) Clone() *DNSConfig {
return dst
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig,RegisterResponse,DERPRegion,DERPMap,DERPNode
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
var _DNSConfigNeedsRegeneration = DNSConfig(struct {
Resolvers []dnstype.Resolver
Routes map[string][]dnstype.Resolver
@ -239,8 +234,7 @@ func (src *RegisterResponse) Clone() *RegisterResponse {
return dst
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig,RegisterResponse,DERPRegion,DERPMap,DERPNode
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
var _RegisterResponseNeedsRegeneration = RegisterResponse(struct {
User User
Login Login
@ -264,8 +258,7 @@ func (src *DERPRegion) Clone() *DERPRegion {
return dst
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig,RegisterResponse,DERPRegion,DERPMap,DERPNode
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
var _DERPRegionNeedsRegeneration = DERPRegion(struct {
RegionID int
RegionCode string
@ -291,8 +284,7 @@ func (src *DERPMap) Clone() *DERPMap {
return dst
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig,RegisterResponse,DERPRegion,DERPMap,DERPNode
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
var _DERPMapNeedsRegeneration = DERPMap(struct {
Regions map[int]*DERPRegion
OmitDefaultRegions bool
@ -309,8 +301,7 @@ func (src *DERPNode) Clone() *DERPNode {
return dst
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type User,Node,Hostinfo,NetInfo,Login,DNSConfig,RegisterResponse,DERPRegion,DERPMap,DERPNode
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
var _DERPNodeNeedsRegeneration = DERPNode(struct {
Name string
RegionID int

@ -2,7 +2,8 @@
// 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 Resolver; DO NOT EDIT.
// Code generated by the following command; DO NOT EDIT.
// tailscale.com/cmd/cloner -type Resolver
package dnstype
@ -22,8 +23,7 @@ func (src *Resolver) Clone() *Resolver {
return dst
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type Resolver
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
var _ResolverNeedsRegeneration = Resolver(struct {
Addr string
BootstrapResolution []netaddr.IP

@ -2,7 +2,8 @@
// 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 Persist; DO NOT EDIT.
// Code generated by the following command; DO NOT EDIT.
// tailscale.com/cmd/cloner -type Persist
package persist
@ -23,8 +24,7 @@ func (src *Persist) Clone() *Persist {
return dst
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type Persist
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
var _PersistNeedsRegeneration = Persist(struct {
_ structs.Incomparable
LegacyFrontendPrivateMachineKey key.MachinePrivate

@ -2,7 +2,8 @@
// 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 Match; DO NOT EDIT.
// Code generated by the following command; DO NOT EDIT.
// tailscale.com/cmd/cloner -type Match
package filter
@ -25,8 +26,7 @@ func (src *Match) Clone() *Match {
return dst
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type Match
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
var _MatchNeedsRegeneration = Match(struct {
IPProto []ipproto.Proto
Dsts []NetPortRange

@ -2,7 +2,8 @@
// 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 Config,Peer; DO NOT EDIT.
// Code generated by the following command; DO NOT EDIT.
// tailscale.com/cmd/cloner -type Config,Peer
package wgcfg
@ -29,8 +30,7 @@ func (src *Config) Clone() *Config {
return dst
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type Config,Peer
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
var _ConfigNeedsRegeneration = Config(struct {
Name string
PrivateKey wgkey.Private
@ -52,8 +52,7 @@ func (src *Peer) Clone() *Peer {
return dst
}
// A compilation failure here means this code must be regenerated, with command:
// tailscale.com/cmd/cloner -type Config,Peer
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
var _PeerNeedsRegeneration = Peer(struct {
PublicKey wgkey.Key
DiscoKey tailcfg.DiscoKey

Loading…
Cancel
Save