From 01ab6004107313f11367588050406300142018b3 Mon Sep 17 00:00:00 2001 From: shoopea Date: Tue, 7 Apr 2020 10:26:04 +0800 Subject: [PATCH] update default values for client config --- client.go | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/client.go b/client.go index 699d7f7..c5186e8 100644 --- a/client.go +++ b/client.go @@ -29,22 +29,15 @@ func loadClients() error { muxClients.Lock() for _, c := range clts { - cx := ChirpClient{} - copier.Copy(&cx, &c) - cx.Active = false - if cx.Config == nil { - cx.Config = &ChirpConfig{ + cx := ChirpClient{ + ChirpConfig{ InterceptPillage: true, Wartime: `🛡Defend`, - } - } else { - if cx.Config.InterceptPillage == nil { - cx.Config.InterceptPillage = true - } - if len(cx.Config.Wartime) == 0 { - cx.Config.Wartime = `🛡Defend` - } + }, } + copier.Copy(&cx, &c) + cx.Active = false + /* cx.MQ.Connection, err = amqp.Dial("amqp://" + cx.MQ.User + ":" + cx.MQ.Password + "@" + cx.MQ.Host + "/" + cx.MQ.Path) logOnError(err, "loadClients : Failed to connect to RabbitMQ")