func Save(path string, v interface{}) error {
	err := os.MkdirAll(filepath.Dir(path), 0755)
	if err != nil {
		return err
	}
	b, err := json.MarshalIndent(v, "", "  ")
	if err != nil {
		return err
	}
	return ioutil.WriteFile(path, b, 0600)
}
Save saves configuration to path. If the directory does not exist, it is created.
package config
import (
	"encoding/json"
	"io/ioutil"
	"os"
	"path/filepath"
)
func Load(path string, v interface{}) error {
	b, err := ioutil.ReadFile(path)
	if os.IsNotExist(err) {
		return nil
	}
	if err != nil {
		return err
	}
	return json.Unmarshal(b, v)
}