✏️ 线程安全

This commit is contained in:
fumiama
2021-08-27 16:54:08 +08:00
parent bf6714f231
commit 3a3c9e5018
3 changed files with 47 additions and 30 deletions

View File

@@ -65,7 +65,7 @@ func LoadText() error {
log.Printf("[Diana]从镜像下载小作文%d字节...", resp.ContentLength)
data, err := io.ReadAll(resp.Body)
if err == nil && len(data) > 0 {
f.Write(data)
_, _ = f.Write(data)
return compo.Unmarshal(data)
}
return err