Closed vasilevkirill closed 2 years ago
hi im use this code
type Interface struct { Name string Enabled bool AutoNegotiation bool Speed int FullDuplex bool FlowControlTx bool FlowControlRx bool } newInterface := Interface{ Name: "SDWAN-CLIENT-878", Enabled: false, } oldInterface := Interface{ Name: "OriginalName", Enabled: true, AutoNegotiation: true, Speed: 1000, FullDuplex: true, FlowControlTx: true, FlowControlRx: false, } if err := mergo.Merge(&newInterface, oldInterface); err != nil { log.Panic(err) } log.Printf("%+v",newInterface)
Log Printing {Name:SDWAN-CLIENT-878 Enabled:true AutoNegotiation:true Speed:1000 FullDuplex:true FlowControlTx:true FlowControlRx:false}
{Name:SDWAN-CLIENT-878 Enabled:true AutoNegotiation:true Speed:1000 FullDuplex:true FlowControlTx:true FlowControlRx:false}
I am waiting Field Enabled equal false same as in the variable newInterface
Enabled
false
newInterface
it's possible in mergo?
thanks.
Thanks for opening a new issue. The team has been notified and will review it as soon as possible. For urgent issues and priority support, visit https://xscode.com/imdario/mergo
issue131_test maybe help you.
hi im use this code
Log Printing
{Name:SDWAN-CLIENT-878 Enabled:true AutoNegotiation:true Speed:1000 FullDuplex:true FlowControlTx:true FlowControlRx:false}
I am waiting Field
Enabled
equalfalse
same as in the variablenewInterface
it's possible in mergo?
thanks.