fix(client/v2): close json file (#20120)

Signed-off-by: guoguangwu <guoguangwug@gmail.com>
This commit is contained in:
guangwu 2024-04-24 04:16:48 +08:00 committed by GitHub
parent 843fc134df
commit 0e3bce7f68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -67,6 +67,11 @@ func (j *jsonMessageFlagValue) Set(s string) error {
return err
}
messageBytes, err = io.ReadAll(jsonFile)
if err != nil {
_ = jsonFile.Close()
return err
}
err = jsonFile.Close()
if err != nil {
return err
}