MCPcopy
hub / github.com/golang/tools / NewEncoder

Method NewEncoder

internal/pkgbits/encoder.go:124–128  ·  view source on GitHub ↗

NewEncoder returns an Encoder for a new element within the given section, and encodes the given SyncMarker as the start of the element bitstream.

(k RelocKind, marker SyncMarker)

Source from the content-addressed store, hash-verified

122// section, and encodes the given SyncMarker as the start of the
123// element bitstream.
124func (pw *PkgEncoder) NewEncoder(k RelocKind, marker SyncMarker) Encoder {
125 e := pw.NewEncoderRaw(k)
126 e.Sync(marker)
127 return e
128}
129
130// NewEncoderRaw returns an Encoder for a new element within the given
131// section.

Callers 13

TestRoundTripFunction · 0.95
GobEncodeMethod · 0.80
RunMethod · 0.80
RunMethod · 0.80
encodeMethod · 0.80
NewJSONHandlerFunction · 0.80
testJSONFunction · 0.80
codeFactFunction · 0.80
GobEncodeMethod · 0.80
checkTranscodeFunction · 0.80
mainFunction · 0.80
EncodeMethod · 0.80

Calls 2

NewEncoderRawMethod · 0.95
SyncMethod · 0.45

Tested by 3

TestRoundTripFunction · 0.76
testJSONFunction · 0.64
checkTranscodeFunction · 0.64