MCPcopy
hub / github.com/tinylib/msgp / writeAndCheckWithArrayLimit

Method writeAndCheckWithArrayLimit

gen/encode.go:43–51  ·  view source on GitHub ↗
(typ string, argfmt string, arg any)

Source from the content-addressed store, hash-verified

41}
42
43func (e *encodeGen) writeAndCheckWithArrayLimit(typ string, argfmt string, arg any) {
44 e.writeAndCheck(typ, argfmt, arg)
45 if e.ctx.marshalLimits && e.ctx.arrayLimit != math.MaxUint32 {
46 e.p.printf("\nif %s > %slimitArrays {", fmt.Sprintf(argfmt, arg), e.ctx.limitPrefix)
47 e.p.printf("\nerr = msgp.ErrLimitExceeded")
48 e.p.printf("\nreturn")
49 e.p.printf("\n}")
50 }
51}
52
53func (e *encodeGen) writeAndCheckWithMapLimit(typ string, argfmt string, arg any) {
54 e.writeAndCheck(typ, argfmt, arg)

Callers 1

gSliceMethod · 0.95

Calls 2

writeAndCheckMethod · 0.95
printfMethod · 0.80

Tested by

no test coverage detected