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

Method writeAndCheck

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

Source from the content-addressed store, hash-verified

29}
30
31func (e *encodeGen) writeAndCheck(typ string, argfmt string, arg any) {
32 if e.ctx.compFloats && typ == "Float64" {
33 typ = "Float"
34 }
35 if e.ctx.newTime && typ == "Time" {
36 typ = "TimeExt"
37 }
38
39 e.p.printf("\nerr = en.Write%s(%s)", typ, fmt.Sprintf(argfmt, arg))
40 e.p.wrapErrCheck(e.ctx.ArgsStr())
41}
42
43func (e *encodeGen) writeAndCheckWithArrayLimit(typ string, argfmt string, arg any) {
44 e.writeAndCheck(typ, argfmt, arg)

Callers 6

binaryEncodeCallMethod · 0.95
gMapMethod · 0.95
gArrayMethod · 0.95
gBaseMethod · 0.95

Calls 3

printfMethod · 0.80
wrapErrCheckMethod · 0.80
ArgsStrMethod · 0.80

Tested by

no test coverage detected