This commit is contained in:
shoopea 2020-01-16 21:32:34 +08:00
parent bb91db0e6a
commit 937a2b61ae

View File

@ -18,11 +18,14 @@ func loadClients() {
b, err := ioutil.ReadFile("./clients.json")
logOnError(err, "loadClients : ReadFile(./clients.json)")
if err != nil {
return err
return
}
err = json.Unmarshal(b, &clts)
logOnError(err, "loadClients : Unmarshal(./clients.json)")
if err != nil {
return
}
muxClients.Lock()
for _, c := range clts {
@ -34,6 +37,8 @@ func loadClients() {
}
muxClients.Unlock()
return
}
func getLockedRoleClient(role string) (*ChirpClient, error) {