(data []byte)
| 50 | } |
| 51 | |
| 52 | func (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 | |
| 71 | func MakeORef(otype string, oid string) ORef { |
| 72 | return ORef{ |
nothing calls this directly
no test coverage detected