// Load load & remove comments from source .json file func Load(fromPath string, toVar interface{}) { file, e := ioutil.ReadFile(fromPath) err.Panic(e) file = RemoveComment(file) err.Panic(json.Unmarshal(file, toVar)) }
func LoadBuf(file []byte, toVar interface{}) { file = RemoveComment(file) err.Panic(json.Unmarshal(file, toVar)) }
// Save config to json format file func Save(fromVar interface{}, toPath string) { data, e := json.Marshal(fromVar) err.Panic(e) e = ioutil.WriteFile(toPath, data, 0664) err.Panic(e) }