v/GTT
1
0
mirror of https://github.com/eeeXun/GTT.git synced 2025-05-27 21:11:11 -07:00
This commit is contained in:
eeeXun 2022-10-22 22:17:27 +08:00
parent 7aa1fba457
commit fa67e9d2ce

View File

@ -41,8 +41,7 @@ func (t Translator) Translate(message string) (string, error) {
return "", err
}
err = json.Unmarshal(body, &data)
if err != nil {
if err = json.Unmarshal(body, &data); err != nil {
return "", err
}
@ -81,8 +80,7 @@ func (t Translator) PlaySound(lang string, message string) {
for player.IsPlaying() {
time.Sleep(time.Second)
}
err = player.Close()
if err != nil {
if err = player.Close(); err != nil {
panic(err)
}
}