From 163093ef6743dfca4ff9fe8171f55e526da6bac0 Mon Sep 17 00:00:00 2001 From: shoopea Date: Mon, 10 Feb 2020 10:23:55 +0800 Subject: [PATCH] test default config value --- client.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/client.go b/client.go index 5ce5f2b..19e7d5a 100644 --- a/client.go +++ b/client.go @@ -29,12 +29,14 @@ func loadClients() error { muxClients.Lock() for _, c := range clts { - cx := ChirpClient{ - Config: &ChirpConfig{ - InterceptPillage: true, - }} + cx := ChirpClient{} copier.Copy(&cx, &c) cx.Active = false + if cx.Config == nil { + cx.Config = &ChirpConfig{ + InterceptPillage: true, + } + } /* 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")