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