UnmarshalJSON reads ObjState from a quoted string.
(b []byte)
| 474 | |
| 475 | // UnmarshalJSON reads ObjState from a quoted string. |
| 476 | func (os *ObjState) UnmarshalJSON(b []byte) error { |
| 477 | if b[0] != '"' || b[len(b)-1] != '"' { |
| 478 | return errors.New("syntax error") |
| 479 | } |
| 480 | state, err := NewObjState(string(b[1 : len(b)-1])) |
| 481 | if err == nil { |
| 482 | *os = state |
| 483 | } |
| 484 | return err |
| 485 | } |
| 486 | |
| 487 | // Scan is an implementation of sql.Scanner interface. It expects the |
| 488 | // value to be a byte slice representation of an ASCII string. |
nothing calls this directly
no test coverage detected