MCPcopy
hub / github.com/wavetermdev/waveterm / UnmarshalJSON

Method UnmarshalJSON

pkg/waveobj/waveobj.go:52–69  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

50}
51
52func (oref *ORef) UnmarshalJSON(data []byte) error {
53 var orefStr string
54 err := json.Unmarshal(data, &orefStr)
55 if err != nil {
56 return err
57 }
58 if len(orefStr) == 0 {
59 oref.OType = ""
60 oref.OID = ""
61 return nil
62 }
63 parsed, err := ParseORef(orefStr)
64 if err != nil {
65 return err
66 }
67 *oref = parsed
68 return nil
69}
70
71func MakeORef(otype string, oid string) ORef {
72 return ORef{

Callers

nothing calls this directly

Calls 1

ParseORefFunction · 0.85

Tested by

no test coverage detected