MCPcopy
hub / github.com/pquerna/ffjson / MarshalJSON

Method MarshalJSON

tests/goser/ff/goser.go:163–165  ·  view source on GitHub ↗

MarshalJSON set ip to json

()

Source from the content-addressed store, hash-verified

161
162// MarshalJSON set ip to json
163func (ip IP) MarshalJSON() ([]byte, error) {
164 return []byte("\"" + net.IP(ip).String() + "\""), nil
165}
166
167// MarshalJSONBuf set ip to json with buf
168func (ip IP) MarshalJSONBuf(buf fflib.EncodingBuffer) error {

Callers 3

BenchmarkFFMarshalJSONFunction · 0.45
BenchmarkFFMarshalJSONFunction · 0.45
FuzzUnmarshalFunction · 0.45

Calls 1

StringMethod · 0.65

Tested by 2

BenchmarkFFMarshalJSONFunction · 0.36
BenchmarkFFMarshalJSONFunction · 0.36