mirror of https://github.com/hashicorp/consul
proto: deep-copy PeeringTrustBundle using proto.Clone (#15004)
Fixes a `go vet` warning caused by the pragma.DoNotCopy on the protobuf message type. Originally I'd hoped we wouldn't need any reflection in the proxycfg hot path, but it seems proto.Clone is the only supported way to copy a message.kisunji/fix-golden
parent
3d2dffff16
commit
641347fe14
@ -1,11 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
readonly PACKAGE_DIR="$(dirname "${BASH_SOURCE[0]}")"
|
|
||||||
cd $PACKAGE_DIR
|
|
||||||
|
|
||||||
# Uses: https://github.com/globusdigital/deep-copy
|
|
||||||
deep-copy -pointer-receiver \
|
|
||||||
-type PeeringTrustBundle \
|
|
||||||
-o ./peering.deepcopy.go \
|
|
||||||
./
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
|||||||
// generated by deep-copy -pointer-receiver -type PeeringTrustBundle -o ./peering.deepcopy.go ./; DO NOT EDIT.
|
|
||||||
|
|
||||||
package pbpeering
|
|
||||||
|
|
||||||
// DeepCopy generates a deep copy of *PeeringTrustBundle
|
|
||||||
func (o *PeeringTrustBundle) DeepCopy() *PeeringTrustBundle {
|
|
||||||
var cp PeeringTrustBundle = *o
|
|
||||||
if o.unknownFields != nil {
|
|
||||||
cp.unknownFields = make([]byte, len(o.unknownFields))
|
|
||||||
copy(cp.unknownFields, o.unknownFields)
|
|
||||||
}
|
|
||||||
if o.RootPEMs != nil {
|
|
||||||
cp.RootPEMs = make([]string, len(o.RootPEMs))
|
|
||||||
copy(cp.RootPEMs, o.RootPEMs)
|
|
||||||
}
|
|
||||||
return &cp
|
|
||||||
}
|
|
Loading…
Reference in new issue