move to a human readable tab-indented JSON config file

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-07 05:40:07 -07:00
parent 5f1dde7e27
commit e4233a1251
3 changed files with 36 additions and 1 deletions

View File

@ -17,3 +17,7 @@ push:
update:
git pull
go get -v -t -u ./...
# make the json config file human readable
json-readable:
cat /tmp/cloud-control-panel.json |jq -r --tab

View File

@ -84,7 +84,7 @@ func parseConfig() {
config.AddDriver(yaml.Driver)
config.AddDriver(json.Driver)
config.LoadFiles("config.yml")
config.LoadFiles("config.json")
for _, addr := range config.Strings("arr1") {
log.Println("addr =", addr)

31
config.json Normal file
View File

@ -0,0 +1,31 @@
{
"BUILDDEBUG": "",
"MAIL": "/var/mail/jcarr",
"USER": "jcarr",
"arr1": [
"lo",
"wifi0",
"docker0"
],
"baseKey": "value2",
"cloud": {
"v000185.testing.com.customers.wprod.wit.com": {
"port": 3333,
"proto": "tcp"
}
},
"debug": false,
"envKey1": "${NotExist|defValue}",
"height": 600,
"hostname": "localhost",
"map1": {
"key1": {
"jwc1": "jcarr1",
"jwc2": "jcarr2"
},
"key2": "val20"
},
"name": "app2",
"shell": "${SHELL}",
"width": 400
}