MCPcopy
hub / github.com/golang/protobuf / isRequiredNotSetError

Function isRequiredNotSetError

proto/proto_test.go:132–135  ·  view source on GitHub ↗

When hooks are enabled, RequiredNotSetError is typed alias to internal/proto package. Binary serialization has not been wrapped yet and hence produces requiredNotSetError instead. This function is a work-around to identify both aliased and non-aliased types.

(err error)

Source from the content-addressed store, hash-verified

130// requiredNotSetError instead. This function is a work-around to identify both
131// aliased and non-aliased types.
132func isRequiredNotSetError(err error) bool {
133 e, ok := err.(interface{ RequiredNotSet() bool })
134 return ok && e.RequiredNotSet()
135}
136
137// Simple tests for numeric encode/decode primitives (varint, etc.)
138func TestNumericPrimitives(t *testing.T) {

Callers 4

TestRequiredNotSetErrorFunction · 0.85
TestRequiredFunction · 0.85

Calls 1

RequiredNotSetMethod · 0.80

Tested by

no test coverage detected