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

Method GobEncode

gopls/internal/cache/analysis.go:520–531  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

518}
519
520func (m actionMap) GobEncode() ([]byte, error) {
521 entries := make([]actionsMapEntry, 0, len(m))
522 for k, v := range m {
523 entries = append(entries, actionsMapEntry{k, v})
524 }
525 sort.Slice(entries, func(i, j int) bool {
526 return entries[i].K < entries[j].K
527 })
528 var buf bytes.Buffer
529 err := gob.NewEncoder(&buf).Encode(entries)
530 return buf.Bytes(), err
531}
532
533func (m *actionMap) GobDecode(data []byte) error {
534 var entries []actionsMapEntry

Callers

nothing calls this directly

Calls 4

BytesMethod · 0.95
appendFunction · 0.85
NewEncoderMethod · 0.80
EncodeMethod · 0.45

Tested by

no test coverage detected