@cryptotaxi247 / kubo / commits / 371bf9310

uodate json option name

License: MIT Signed-off-by: Kejie Zhang <601172892@qq.com>

Kejie Zhang committed Oct 5, 2018 at 10:59 UTC 371bf9310ec55adb8f2619d5dc0d10f0767160d6
1 file changed +3 -3
core/commands/config.go
+3 -3
@@ -27,7 +27,7 @@ type ConfigField struct {
27
28 const (
29 configBoolOptionName = "bool"
30 - configJsonOptionName = "json"
30 + configJSONOptionName = "json"
31 )
32
33 var ConfigCmd = &cmds.Command{
@@ -60,7 +60,7 @@ Set the value of the 'Datastore.Path' key:
60 },
61 Options: []cmdkit.Option{
62 cmdkit.BoolOption(configBoolOptionName, "Set a boolean value."),
63 - cmdkit.BoolOption(configJsonOptionName, "Parse stringified JSON."),
63 + cmdkit.BoolOption(configJSONOptionName, "Parse stringified JSON."),
64 },
65 Run: func(req cmds.Request, res cmds.Response) {
66 args := req.Arguments()
@@ -92,7 +92,7 @@ Set the value of the 'Datastore.Path' key:
92 if len(args) == 2 {
93 value := args[1]
94
95 - if parseJson, _, _ := req.Option(configJsonOptionName).Bool(); parseJson {
95 + if parseJSON, _, _ := req.Option(configJSONOptionName).Bool(); parseJSON {
96 var jsonVal interface{}
97 if err := json.Unmarshal([]byte(value), &jsonVal); err != nil {
98 err = fmt.Errorf("failed to unmarshal json. %s", err)