From c91d38f96cf7f2c26022cb2a8303b3723b00edf0 Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Wed, 31 May 2023 11:51:04 +1000 Subject: [PATCH] fix json keys --- README.md | 6 +++--- cmd/main/main.go | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 264811b..7e0ae01 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,6 @@ Advanced settings can be provided via a top level json key named "config". Here | Key | Example Value | Description | |---------------|---------------|---------------------------| -| key-order | "Column3,Column1,Column2"| Comma separated list of column names in the desired order | -| overwrite-file | true | Boolean indicating whether output file should be overwritten if it already exists | -| parent-node | "results" | Specify an alternate starting key for the spreadsheet data than just the first non-config key. Useful with json structures with multiple top-level keys | \ No newline at end of file +| keyOrder | "Column3,Column1,Column2"| Comma separated list of column names in the desired order | +| overwriteFile | true | Boolean indicating whether output file should be overwritten if it already exists | +| parentNode | "results" | Specify an alternate starting key for the spreadsheet data than just the first non-config key. Useful with json structures with multiple top-level keys | \ No newline at end of file diff --git a/cmd/main/main.go b/cmd/main/main.go index 9d01039..02bc325 100644 --- a/cmd/main/main.go +++ b/cmd/main/main.go @@ -114,18 +114,18 @@ func main() { // Parse each key into our config struct for _, key := range configKeys { - if strings.EqualFold(key, "key-order") { - fmt.Printf("Found config element for key-order\n") + if strings.EqualFold(key, "keyOrder") { + fmt.Printf("Found config element for keyOrder\n") e, _ := configMap.Get(key) for i, e := range strings.Split(e.(string), ",") { config.keyOrder[i] = e } fmt.Printf("Column order is now : '%v'\n", config.keyOrder) - } else if strings.EqualFold(key, "overwrite-file") { + } else if strings.EqualFold(key, "overwriteFile") { fmt.Printf("Found config element for overwriting output file\n") e, _ := configMap.Get(key) overwriteFile = e.(bool) - } else if strings.EqualFold(key, "parent-node") { + } else if strings.EqualFold(key, "parentNode") { fmt.Printf("Found config element for forcing parent key for spreadsheet data\n") e, _ := configMap.Get(key) config.parentOverride = e.(string)