v/GTT
1
0
mirror of https://github.com/eeeXun/GTT.git synced 2025-05-29 05:50:17 -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 return "", err
} }
err = json.Unmarshal(body, &data) if err = json.Unmarshal(body, &data); err != nil {
if err != nil {
return "", err return "", err
} }
@ -81,8 +80,7 @@ func (t Translator) PlaySound(lang string, message string) {
for player.IsPlaying() { for player.IsPlaying() {
time.Sleep(time.Second) time.Sleep(time.Second)
} }
err = player.Close() if err = player.Close(); err != nil {
if err != nil {
panic(err) panic(err)
} }
} }