func (e JSONParseError) Error() string {
	return fmt.Sprintf("error parsing JSON config: %v", e.Inner)
}
Error implenents the error interface.
package ff
import (
	"encoding/json"
	"fmt"
	"io"
	"strconv"
)
func JSONParser(r io.Reader, set func(name, value string) error) error {
	var m map[string]interface{}
	d := json.NewDecoder(r)
	d.UseNumber()  
	if err := d.Decode(&m); err != nil {
		return JSONParseError{Inner: err}
	}
	for key, val := range m {
		values, err := stringifySlice(val)
		if err != nil {
			return JSONParseError{Inner: err}
		}
		for _, value := range values {
			if err := set(key, value); err != nil {
				return err
			}
		}
	}
	return nil
}
func stringifySlice(val interface{}) ([]string, error) {
	if vals, ok := val.([]interface{}); ok {
		ss := make([]string, len(vals))
		for i := range vals {
			s, err := stringifyValue(vals[i])
			if err != nil {
				return nil, err
			}
			ss[i] = s
		}
		return ss, nil
	}
	s, err := stringifyValue(val)
	if err != nil {
		return nil, err
	}
	return []string{s}, nil
}
func stringifyValue(val interface{}) (string, error) {
	switch v := val.(type) {
	case string:
		return v, nil
	case json.Number:
		return v.String(), nil
	case bool:
		return strconv.FormatBool(v), nil
	default:
		return "", StringConversionError{Value: val}
	}
}
type JSONParseError struct {
	Inner error
}