-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
28 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ package translator | |
import ( | ||
"encoding/json" | ||
"fmt" | ||
"io/ioutil" | ||
"os" | ||
"path/filepath" | ||
"strings" | ||
|
@@ -53,7 +52,7 @@ func (cf *configFile) decode(data []byte, args *Lingualeo) error { | |
} | ||
|
||
func (cf *configFile) decodeFile(args *Lingualeo) error { | ||
data, err := ioutil.ReadFile(cf.filename) | ||
data, err := os.ReadFile(cf.filename) | ||
if err != nil { | ||
return err | ||
} | ||
|
@@ -99,7 +98,7 @@ func prepareCliArgs(version string) Lingualeo { | |
app.ArgsUsage = "Multiple words can be supplied" | ||
app.Action = defaultCommand | ||
app.Description = ` | ||
It is possible to use config file to set predefined parameters | ||
It is possible to use config file to set predefined parameters | ||
Default config files are: ~/lingualeo.[toml|yml|yaml|json] | ||
Toml format example: | ||
|
@@ -110,18 +109,18 @@ func prepareCliArgs(version string) Lingualeo { | |
sound = true | ||
player = "mplayer" | ||
download = false | ||
Yaml format example: | ||
email: [email protected] | ||
password: password | ||
add: false | ||
sound: true | ||
player: mplayer | ||
download: false | ||
JSON format example: | ||
{ | ||
"email": "[email protected]", | ||
"password": "password", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters