package run
Import Path
github.com/goccy/go-json/internal/encoder/run (on go.dev)
Dependency Relation
imports 10 packages, and imported by one package
Involved Source Files
encode_of.go
Package run drives the encoder: it compiles the opcodes of a value, sets up the runtime context and runs the
VM which the options choose. The v1 and the v2 json packages encode through it.
Package-Level Functions (total 5)
Code runs the opcodes of a value, which ctx is set up for, by the VM of the options of ctx.
Encode appends v to the buffer of ctx as JSON, with a comma after it, by the options of ctx. On an error, it
returns the output written before the error with it, which the v2 json package finds the place of the error by.
EncodeIndent is Encode with the indentation and the prefix of each line.
Type Parameters:
T: any
EncodeOf encodes the value at v, as Encode encodes it, without the copy of the value to the heap which an
interface value of it would be: it is copied to a value in the heap which is reused ( see
encoder.OpcodeSet.TakeValue ). A value which an interface value holds directly is encoded by Encode.
IndentCode is Code with the indentation and the prefix of each line.
Package-Level Constants (only one)
MaxReusedValueSize is the size of the largest value which EncodeOf, and the decoding of a value by its type,
copy to a value they reuse. Every runtime context in the pool keeps such a value, so a large one is left to the
GC.
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |