Changeset 9 in code for trunk/main.go
- Timestamp:
- Feb 11, 2023, 11:04:52 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/main.go
r8 r9 1 // $ KyokoNet: stcli,v 1.3 2022/12/13 23:57:00akoizumi Exp1 // $TheSupernovaDuo: stcli,v 1.3.1 2023/02/11 07:54:25 akoizumi Exp 2 2 // Command line client for SimplyTranslate, a privacy friendly frontend to other translation engines 3 3 package main … … 33 33 // Check if any of those two variables is empty. 34 34 // It actually needs the two to have content. 35 if len(input) == 0 || len(to) == 0{36 log.Fatal("Missing either the text or the target language.")35 if len(input) == 0 { 36 log.Fatal("Missing input.") 37 37 } 38 38 // Map a variable to the struct … … 45 45 sanityCheck(err) 46 46 defer resp.Body.Close() 47 // JSON decoding 47 48 _ = json.NewDecoder(resp.Body).Decode(&translate) 48 49 sanityCheck(err)
Note:
See TracChangeset
for help on using the changeset viewer.