UnmarshalJSON unmarshals the JSON encoded data into u.
(data []byte)
| 97 | |
| 98 | // UnmarshalJSON unmarshals the JSON encoded data into u. |
| 99 | func (u *UUID) UnmarshalJSON(data []byte) error { |
| 100 | var uuidString string |
| 101 | if err := json.Unmarshal(data, &uuidString); err != nil { |
| 102 | return err |
| 103 | } |
| 104 | uuid, err := FromString(uuidString) |
| 105 | *u = uuid |
| 106 | return err |
| 107 | } |
| 108 | |
| 109 | // defaultRandReader is an io.Reader that calls through to "math/rand".Read |
| 110 | // which is safe for concurrent use. |
nothing calls this directly
no test coverage detected