1
// Copyright 2014 Canonical Ltd.
2
// Licensed under the AGPLv3, see LICENCE file for details.
4
package storetesting // import "gopkg.in/juju/charmstore.v5-unstable/internal/storetesting"
12
// MustMarshalJSON marshals the specified value using json.Marshal and
13
// returns the corresponding byte slice. If there is an error marshalling
14
// the value then MustMarshalJSON will panic.
15
func MustMarshalJSON(v interface{}) []byte {
16
data, err := json.Marshal(v)
23
// JSONReader creates an io.Reader which can read the Marshalled value of v.
24
func JSONReader(v interface{}) io.Reader {
25
return bytes.NewReader(MustMarshalJSON(v))