From d5ab18b2e62760ab2870e3909c15f11e6ece3dca Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Thu, 16 Sep 2021 15:58:43 -0700 Subject: [PATCH] cmd/cloner: add Clone context to regen struct assignments Signed-off-by: Josh Bleecher Snyder --- cmd/cloner/cloner.go | 2 +- ipn/prefs_clone.go | 2 +- tailcfg/tailcfg_clone.go | 20 ++++++++++---------- types/dnstype/dnstype_clone.go | 2 +- types/persist/persist_clone.go | 2 +- wgengine/filter/match_clone.go | 2 +- wgengine/wgcfg/clone.go | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/cmd/cloner/cloner.go b/cmd/cloner/cloner.go index 322118170..19f20a771 100644 --- a/cmd/cloner/cloner.go +++ b/cmd/cloner/cloner.go @@ -243,7 +243,7 @@ func gen(buf *bytes.Buffer, imports map[string]struct{}, name string, typ *types writef("return dst") fmt.Fprintf(buf, "}\n\n") - buf.Write(codegen.AssertStructUnchanged(t, name, "", thisPkg, imports)) + buf.Write(codegen.AssertStructUnchanged(t, name, "Clone", thisPkg, imports)) } } diff --git a/ipn/prefs_clone.go b/ipn/prefs_clone.go index 1f95af91a..035228588 100644 --- a/ipn/prefs_clone.go +++ b/ipn/prefs_clone.go @@ -32,7 +32,7 @@ func (src *Prefs) Clone() *Prefs { } // A compilation failure here means this code must be regenerated, with the command at the top of this file. -var _PrefsNeedsRegeneration = Prefs(struct { +var _PrefsCloneNeedsRegeneration = Prefs(struct { ControlURL string RouteAll bool AllowSingleHosts bool diff --git a/tailcfg/tailcfg_clone.go b/tailcfg/tailcfg_clone.go index 2f2f63e96..d906a6dff 100644 --- a/tailcfg/tailcfg_clone.go +++ b/tailcfg/tailcfg_clone.go @@ -29,7 +29,7 @@ func (src *User) Clone() *User { } // A compilation failure here means this code must be regenerated, with the command at the top of this file. -var _UserNeedsRegeneration = User(struct { +var _UserCloneNeedsRegeneration = User(struct { ID UserID LoginName string DisplayName string @@ -65,7 +65,7 @@ func (src *Node) Clone() *Node { } // A compilation failure here means this code must be regenerated, with the command at the top of this file. -var _NodeNeedsRegeneration = Node(struct { +var _NodeCloneNeedsRegeneration = Node(struct { ID NodeID StableID StableNodeID Name string @@ -108,7 +108,7 @@ func (src *Hostinfo) Clone() *Hostinfo { } // A compilation failure here means this code must be regenerated, with the command at the top of this file. -var _HostinfoNeedsRegeneration = Hostinfo(struct { +var _HostinfoCloneNeedsRegeneration = Hostinfo(struct { IPNVersion string FrontendLogID string BackendLogID string @@ -144,7 +144,7 @@ func (src *NetInfo) Clone() *NetInfo { } // A compilation failure here means this code must be regenerated, with the command at the top of this file. -var _NetInfoNeedsRegeneration = NetInfo(struct { +var _NetInfoCloneNeedsRegeneration = NetInfo(struct { MappingVariesByDestIP opt.Bool HairPinning opt.Bool WorkingIPv6 opt.Bool @@ -170,7 +170,7 @@ func (src *Login) Clone() *Login { } // A compilation failure here means this code must be regenerated, with the command at the top of this file. -var _LoginNeedsRegeneration = Login(struct { +var _LoginCloneNeedsRegeneration = Login(struct { _ structs.Incomparable ID LoginID Provider string @@ -210,7 +210,7 @@ func (src *DNSConfig) Clone() *DNSConfig { } // A compilation failure here means this code must be regenerated, with the command at the top of this file. -var _DNSConfigNeedsRegeneration = DNSConfig(struct { +var _DNSConfigCloneNeedsRegeneration = DNSConfig(struct { Resolvers []dnstype.Resolver Routes map[string][]dnstype.Resolver FallbackResolvers []dnstype.Resolver @@ -235,7 +235,7 @@ func (src *RegisterResponse) Clone() *RegisterResponse { } // A compilation failure here means this code must be regenerated, with the command at the top of this file. -var _RegisterResponseNeedsRegeneration = RegisterResponse(struct { +var _RegisterResponseCloneNeedsRegeneration = RegisterResponse(struct { User User Login Login NodeKeyExpired bool @@ -259,7 +259,7 @@ func (src *DERPRegion) Clone() *DERPRegion { } // A compilation failure here means this code must be regenerated, with the command at the top of this file. -var _DERPRegionNeedsRegeneration = DERPRegion(struct { +var _DERPRegionCloneNeedsRegeneration = DERPRegion(struct { RegionID int RegionCode string RegionName string @@ -285,7 +285,7 @@ func (src *DERPMap) Clone() *DERPMap { } // A compilation failure here means this code must be regenerated, with the command at the top of this file. -var _DERPMapNeedsRegeneration = DERPMap(struct { +var _DERPMapCloneNeedsRegeneration = DERPMap(struct { Regions map[int]*DERPRegion OmitDefaultRegions bool }{}) @@ -302,7 +302,7 @@ func (src *DERPNode) Clone() *DERPNode { } // A compilation failure here means this code must be regenerated, with the command at the top of this file. -var _DERPNodeNeedsRegeneration = DERPNode(struct { +var _DERPNodeCloneNeedsRegeneration = DERPNode(struct { Name string RegionID int HostName string diff --git a/types/dnstype/dnstype_clone.go b/types/dnstype/dnstype_clone.go index 6b9afa533..2c0b45a85 100644 --- a/types/dnstype/dnstype_clone.go +++ b/types/dnstype/dnstype_clone.go @@ -24,7 +24,7 @@ func (src *Resolver) Clone() *Resolver { } // A compilation failure here means this code must be regenerated, with the command at the top of this file. -var _ResolverNeedsRegeneration = Resolver(struct { +var _ResolverCloneNeedsRegeneration = Resolver(struct { Addr string BootstrapResolution []netaddr.IP }{}) diff --git a/types/persist/persist_clone.go b/types/persist/persist_clone.go index 60855ceec..62b34d125 100644 --- a/types/persist/persist_clone.go +++ b/types/persist/persist_clone.go @@ -25,7 +25,7 @@ func (src *Persist) Clone() *Persist { } // A compilation failure here means this code must be regenerated, with the command at the top of this file. -var _PersistNeedsRegeneration = Persist(struct { +var _PersistCloneNeedsRegeneration = Persist(struct { _ structs.Incomparable LegacyFrontendPrivateMachineKey key.MachinePrivate PrivateNodeKey wgkey.Private diff --git a/wgengine/filter/match_clone.go b/wgengine/filter/match_clone.go index 4b8dc299c..ea5a70254 100644 --- a/wgengine/filter/match_clone.go +++ b/wgengine/filter/match_clone.go @@ -27,7 +27,7 @@ func (src *Match) Clone() *Match { } // A compilation failure here means this code must be regenerated, with the command at the top of this file. -var _MatchNeedsRegeneration = Match(struct { +var _MatchCloneNeedsRegeneration = Match(struct { IPProto []ipproto.Proto Dsts []NetPortRange Srcs []netaddr.IPPrefix diff --git a/wgengine/wgcfg/clone.go b/wgengine/wgcfg/clone.go index e5193d82b..ffd5726a1 100644 --- a/wgengine/wgcfg/clone.go +++ b/wgengine/wgcfg/clone.go @@ -31,7 +31,7 @@ func (src *Config) Clone() *Config { } // A compilation failure here means this code must be regenerated, with the command at the top of this file. -var _ConfigNeedsRegeneration = Config(struct { +var _ConfigCloneNeedsRegeneration = Config(struct { Name string PrivateKey wgkey.Private Addresses []netaddr.IPPrefix @@ -53,7 +53,7 @@ func (src *Peer) Clone() *Peer { } // A compilation failure here means this code must be regenerated, with the command at the top of this file. -var _PeerNeedsRegeneration = Peer(struct { +var _PeerCloneNeedsRegeneration = Peer(struct { PublicKey wgkey.Key DiscoKey tailcfg.DiscoKey AllowedIPs []netaddr.IPPrefix