tweak helpers

This commit is contained in:
Jakub
2020-12-17 00:13:16 +01:00
committed by James Houlahan
parent d3b0871cf1
commit b36ac532c9
4 changed files with 19 additions and 10 deletions

View File

@ -40,6 +40,7 @@ func createApp() *cli.App { // nolint[funlen]
app.Flags = []cli.Flag{
&cli.StringFlag{
Name: "root",
Aliases: []string{"C"},
Usage: "The root directory from which to begin recursive hashing",
Required: true,
},

View File

@ -166,12 +166,14 @@ func fetch(app, platform string) map[string]versionInfo {
res, err := resty.New().R().Get(url)
if err != nil {
println("fetch failed", err.Error())
return make(map[string]versionInfo)
}
var versionMap map[string]versionInfo
if err := json.Unmarshal(res.Body(), &versionMap); err != nil {
println("unmarshal failed", err.Error())
return make(map[string]versionInfo)
}