MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / MustJSONMarshal

Function MustJSONMarshal

base/util_testing.go:948–952  ·  view source on GitHub ↗

MustJSONMarshal marshals the given value to JSON, and errors the test if it can not be turned into json.

(t testing.TB, v interface{})

Source from the content-addressed store, hash-verified

946
947// MustJSONMarshal marshals the given value to JSON, and errors the test if it can not be turned into json.
948func MustJSONMarshal(t testing.TB, v interface{}) []byte {
949 b, err := JSONMarshal(v)
950 require.NoError(t, err)
951 return b
952}
953
954// numFilesInDir counts the number of files in a given directory
955func numFilesInDir(t *testing.T, dir string, recursive bool) int {

Calls 1

JSONMarshalFunction · 0.70