// JSON configures the dictionary to use to render a templated asset.
JSON configures the dictionary to use to render a templated asset.
// JSON configures the dictionary to use to render a templated asset .
func JSON(j string) Option {
	return func(opts *options) error {
		if j == "" {
			opts.data = map[string]interface{}{}
			return nil
		}
		var data map[string]interface{}
		err := json.Unmarshal([]byte(j), &data)
		if err != nil {
			return err
		}
		opts.data = data
		return nil
	}
}
func JSON ( j string ) Option { return func ( opts * options ) error { if j == " " { opts . data = map [ string ] interface { } { } return nil } var data map [ string ] interface { } err := json . Unmarshal ( [ ] byte ( j ) , & data ) if err != nil { return err } opts . data = data return nil } }
JSON configures the dictionary to use to render a templated asset.
JSON configures the dictionary to use to render a templated asset .