MCPcopy Index your code
hub / github.com/tinylib/msgp / WriteMapStrStr

Method WriteMapStrStr

msgp/write.go:587–603  ·  view source on GitHub ↗

WriteMapStrStr writes a map[string]string to the writer

(mp map[string]string)

Source from the content-addressed store, hash-verified

585
586// WriteMapStrStr writes a map[string]string to the writer
587func (mw *Writer) WriteMapStrStr(mp map[string]string) (err error) {
588 err = mw.WriteMapHeader(uint32(len(mp)))
589 if err != nil {
590 return
591 }
592 for key, val := range mp {
593 err = mw.WriteString(key)
594 if err != nil {
595 return
596 }
597 err = mw.WriteString(val)
598 if err != nil {
599 return
600 }
601 }
602 return nil
603}
604
605// WriteMapStrIntf writes a map[string]interface to the writer
606func (mw *Writer) WriteMapStrIntf(mp map[string]any) (err error) {

Callers 4

TestCopyJSONFunction · 0.95
BenchmarkCopyToJSONFunction · 0.95
WriteIntfMethod · 0.95
BenchmarkUnmarshalAsJSONFunction · 0.95

Calls 2

WriteMapHeaderMethod · 0.95
WriteStringMethod · 0.95

Tested by 3

TestCopyJSONFunction · 0.76
BenchmarkCopyToJSONFunction · 0.76
BenchmarkUnmarshalAsJSONFunction · 0.76