// WriteJSON marshals the given data as JSON and writes it to the specified location.
WriteJSON marshals the given data as JSON and writes it to the specified location.
// WriteJSON marshals the given data as JSON and writes it to the specified location .
func WriteJSON(data interface{}, root, dir, name string) error {
	filePath := filepath.Join(root, dir, name+".json")
	changeBytes, err := json.MarshalIndent(data, "", " ")
	if err != nil {
		return err
	}
	return WriteFile(changeBytes, filePath, false)
}
func WriteJSON ( data interface { } , root , dir , name string ) error { filePath := filepath . Join ( root , dir , name + " " ) changeBytes , err := json . MarshalIndent ( data , " " , " " ) if err != nil { return err } return WriteFile ( changeBytes , filePath , false ) }
WriteJSON marshals the given data as JSON and writes it to the specified location.
WriteJSON marshals the given data as JSON and writes it to the specified location .