func (ch *ConsistentHash) MarshalJSON() ([]byte, error) {
	ch.mu.RLock()
	defer ch.mu.RUnlock()

	return json.Marshal(ch.hashring)
}
// MarshalJSON marshals the consistent hash as json.
//
// The form of the returned json is the underlying []HashedBucket
// and there is no corresponding `UnmarshalJSON` because
// it is uncertain on the other end what the hashfunction is
// because functions can't be json serialized.
//
// You should use MarshalJSON for communicating information
// for debugging purposes only.
//
// Calling `MarshalJSON` is safe to do concurrently and acquires
// a read lock on the consistent hash reference.
MarshalJSON marshals the consistent hash as json.

The form of the returned json is the underlying []HashedBucket
and there is no corresponding `UnmarshalJSON` because
it is uncertain on the other end what the hashfunction is
because functions can't be json serialized.

You should use MarshalJSON for communicating information
for debugging purposes only.

Calling `MarshalJSON` is safe to do concurrently and acquires
a read lock on the consistent hash reference.
// MarshalJSON marshals the consistent hash as json . // // The form of the returned json is the underlying [] HashedBucket // and there is no corresponding ` UnmarshalJSON ` because // it is uncertain on the other end what the hashfunction is // because functions can ' t be json serialized . // // You should use MarshalJSON for communicating information // for debugging purposes only . // // Calling ` MarshalJSON ` is safe to do concurrently and acquires // a read lock on the consistent hash reference .
func (ch *ConsistentHash) MarshalJSON() ([]byte, error) {
	ch.mu.RLock()
	defer ch.mu.RUnlock()
	return json.Marshal(ch.hashring)
}
func ( ch * ConsistentHash ) MarshalJSON ( ) ( [ ] byte , error ) { ch . mu . RLock ( ) defer ch . mu . RUnlock ( ) return json . Marshal ( ch . hashring ) }
MarshalJSON marshals the consistent hash as json.
MarshalJSON marshals the consistent hash as json .