empty string error handling

This commit is contained in:
2023-10-20 23:16:28 +03:00
parent 067a53110e
commit dcdee48bb0
3 changed files with 5 additions and 2 deletions

View File

@@ -40,8 +40,9 @@ func main() {
panic(err)
}
}
text = strings.Trim(text, "\n")
if len(text) == 0 {
os.Exit(1)
continue
}
result, err := gt.Translate(text, source, into)
if err != nil {