Commit d29e3a1a authored by guangwu's avatar guangwu Committed by GitHub

fix: close atomicFile (#10203)

parent bd7b882c
...@@ -31,6 +31,7 @@ func AtomicEncode(path string, val any) error { ...@@ -31,6 +31,7 @@ func AtomicEncode(path string, val any) error {
if err != nil { if err != nil {
return err return err
} }
defer atomicFile.Close()
if err = json.NewEncoder(atomicFile).Encode(val); err != nil { if err = json.NewEncoder(atomicFile).Encode(val); err != nil {
return err return err
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment