perf: codes

master
zggsong 2 years ago
parent e72f467bf1
commit 0b870a850e

@ -16,19 +16,17 @@ func init() {
global.GLO_CONF_CH = make(chan model.Config) global.GLO_CONF_CH = make(chan model.Config)
global.GLO_CONF = config.InitialConfig() global.GLO_CONF = config.InitialConfig()
bytes, _ := json.Marshal(global.GLO_CONF) bytes, _ := json.Marshal(global.GLO_CONF)
log.Printf(string(bytes)) log.Println(string(bytes))
} }
func main() { func main() {
send() send()
for { for {
select { global.GLO_CONF = <-global.GLO_CONF_CH
case global.GLO_CONF = <-global.GLO_CONF_CH:
bytes, _ := json.Marshal(global.GLO_CONF) bytes, _ := json.Marshal(global.GLO_CONF)
log.Printf(string(bytes)) log.Println(string(bytes))
send() send()
} }
}
} }
func send() { func send() {

Loading…
Cancel
Save