cockroach: Index | Files

package protoutil

import ""


Package Files

clone.go marshal.go


var Interceptor = func(_ proto.Message) {}

Interceptor will be called with every proto before it is marshalled. Interceptor is not safe to modify concurrently with calls to Marshal.

func Clone Uses

func Clone(pb proto.Message) proto.Message

Clone uses proto.Clone to return a deep copy of pb. It panics if pb recursively contains any instances of types which are known to be unsupported by proto.Clone.

This function and its associated lint (see `make check`) exist to ensure we do not attempt to proto.Clone types which are not supported by proto.Clone. This hackery is necessary because proto.Clone gives no direct indication that it has incompletely cloned a type; it merely logs to standard output (see

The concrete case against which this is currently guarding may be resolved upstream, see

func Marshal Uses

func Marshal(pb proto.Message) ([]byte, error)

Marshal uses proto.Marshal to encode pb into the wire format. It is used in some tests to intercept calls to proto.Marshal.

Package protoutil imports 4 packages (graph). Updated 2017-03-13. Refresh now. Tools for package owners. This is a dead-end fork (no commits since the fork).