From 371bf9310ec55adb8f2619d5dc0d10f0767160d6 Mon Sep 17 00:00:00 2001 From: Kejie Zhang <601172892@qq.com> Date: Fri, 5 Oct 2018 10:59:01 +0800 Subject: [PATCH] uodate json option name License: MIT Signed-off-by: Kejie Zhang <601172892@qq.com> --- core/commands/config.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/commands/config.go b/core/commands/config.go index 9d8476344..b451b3d09 100644 --- a/core/commands/config.go +++ b/core/commands/config.go @@ -27,7 +27,7 @@ type ConfigField struct { const ( configBoolOptionName = "bool" - configJsonOptionName = "json" + configJSONOptionName = "json" ) var ConfigCmd = &cmds.Command{ @@ -60,7 +60,7 @@ Set the value of the 'Datastore.Path' key: }, Options: []cmdkit.Option{ cmdkit.BoolOption(configBoolOptionName, "Set a boolean value."), - cmdkit.BoolOption(configJsonOptionName, "Parse stringified JSON."), + cmdkit.BoolOption(configJSONOptionName, "Parse stringified JSON."), }, Run: func(req cmds.Request, res cmds.Response) { args := req.Arguments() @@ -92,7 +92,7 @@ Set the value of the 'Datastore.Path' key: if len(args) == 2 { value := args[1] - if parseJson, _, _ := req.Option(configJsonOptionName).Bool(); parseJson { + if parseJSON, _, _ := req.Option(configJSONOptionName).Bool(); parseJSON { var jsonVal interface{} if err := json.Unmarshal([]byte(value), &jsonVal); err != nil { err = fmt.Errorf("failed to unmarshal json. %s", err)