MCPcopy
hub / github.com/kopia/kopia / MarshalJSON

Method MarshalJSON

repo/object/objectid.go:27–32  ·  view source on GitHub ↗

MarshalJSON implements JSON serialization of IDs.

()

Source from the content-addressed store, hash-verified

25
26// MarshalJSON implements JSON serialization of IDs.
27func (i ID) MarshalJSON() ([]byte, error) {
28 s := i.String()
29
30 //nolint:wrapcheck
31 return json.Marshal(s)
32}
33
34// UnmarshalJSON implements JSON deserialization of IDs.
35func (i *ID) UnmarshalJSON(v []byte) error {

Callers 1

Calls 1

StringMethod · 0.95

Tested by 1