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 // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // 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 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{}) { writeRegen := func(format string, args ...interface{}) {
fmt.Fprintf(regenBuf, format+"\n", args...) fmt.Fprintf(regenBuf, format+"\n", args...)
} }
writeRegen("// A compilation failure here means this code must be regenerated, with command:") writeRegen("// A compilation failure here means this code must be regenerated, with the command at the top of this file.")
writeRegen("// tailscale.com/cmd/cloner -type %s", *flagTypes)
writeRegen("var _%sNeedsRegeneration = %s(struct {", name, name) writeRegen("var _%sNeedsRegeneration = %s(struct {", name, name)
name := typ.Obj().Name() name := typ.Obj().Name()

@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // 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 package ipn
@ -30,8 +31,7 @@ func (src *Prefs) Clone() *Prefs {
return dst return dst
} }
// A compilation failure here means this code must be regenerated, with command: // A compilation failure here means this code must be regenerated, with the command at the top of this file.
// tailscale.com/cmd/cloner -type Prefs
var _PrefsNeedsRegeneration = Prefs(struct { var _PrefsNeedsRegeneration = Prefs(struct {
ControlURL string ControlURL string
RouteAll bool RouteAll bool

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

@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // 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 package dnstype
@ -22,8 +23,7 @@ func (src *Resolver) Clone() *Resolver {
return dst return dst
} }
// A compilation failure here means this code must be regenerated, with command: // A compilation failure here means this code must be regenerated, with the command at the top of this file.
// tailscale.com/cmd/cloner -type Resolver
var _ResolverNeedsRegeneration = Resolver(struct { var _ResolverNeedsRegeneration = Resolver(struct {
Addr string Addr string
BootstrapResolution []netaddr.IP BootstrapResolution []netaddr.IP

@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // 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 package persist
@ -23,8 +24,7 @@ func (src *Persist) Clone() *Persist {
return dst return dst
} }
// A compilation failure here means this code must be regenerated, with command: // A compilation failure here means this code must be regenerated, with the command at the top of this file.
// tailscale.com/cmd/cloner -type Persist
var _PersistNeedsRegeneration = Persist(struct { var _PersistNeedsRegeneration = Persist(struct {
_ structs.Incomparable _ structs.Incomparable
LegacyFrontendPrivateMachineKey key.MachinePrivate LegacyFrontendPrivateMachineKey key.MachinePrivate

@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // 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 package filter
@ -25,8 +26,7 @@ func (src *Match) Clone() *Match {
return dst return dst
} }
// A compilation failure here means this code must be regenerated, with command: // A compilation failure here means this code must be regenerated, with the command at the top of this file.
// tailscale.com/cmd/cloner -type Match
var _MatchNeedsRegeneration = Match(struct { var _MatchNeedsRegeneration = Match(struct {
IPProto []ipproto.Proto IPProto []ipproto.Proto
Dsts []NetPortRange Dsts []NetPortRange

@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // 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 package wgcfg
@ -29,8 +30,7 @@ func (src *Config) Clone() *Config {
return dst return dst
} }
// A compilation failure here means this code must be regenerated, with command: // A compilation failure here means this code must be regenerated, with the command at the top of this file.
// tailscale.com/cmd/cloner -type Config,Peer
var _ConfigNeedsRegeneration = Config(struct { var _ConfigNeedsRegeneration = Config(struct {
Name string Name string
PrivateKey wgkey.Private PrivateKey wgkey.Private
@ -52,8 +52,7 @@ func (src *Peer) Clone() *Peer {
return dst return dst
} }
// A compilation failure here means this code must be regenerated, with command: // A compilation failure here means this code must be regenerated, with the command at the top of this file.
// tailscale.com/cmd/cloner -type Config,Peer
var _PeerNeedsRegeneration = Peer(struct { var _PeerNeedsRegeneration = Peer(struct {
PublicKey wgkey.Key PublicKey wgkey.Key
DiscoKey tailcfg.DiscoKey DiscoKey tailcfg.DiscoKey

Loading…
Cancel
Save