From 0b870a850e336d5485cc8180fdb612b87343f341 Mon Sep 17 00:00:00 2001 From: zggsong Date: Fri, 28 Oct 2022 10:35:07 +0800 Subject: [PATCH] perf: codes --- main.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/main.go b/main.go index d6285cf..5c4dd7b 100644 --- a/main.go +++ b/main.go @@ -16,18 +16,16 @@ func init() { global.GLO_CONF_CH = make(chan model.Config) global.GLO_CONF = config.InitialConfig() bytes, _ := json.Marshal(global.GLO_CONF) - log.Printf(string(bytes)) + log.Println(string(bytes)) } func main() { send() for { - select { - case global.GLO_CONF = <-global.GLO_CONF_CH: - bytes, _ := json.Marshal(global.GLO_CONF) - log.Printf(string(bytes)) - send() - } + global.GLO_CONF = <-global.GLO_CONF_CH + bytes, _ := json.Marshal(global.GLO_CONF) + log.Println(string(bytes)) + send() } }