MCPcopy
hub / github.com/tinode/chat / UnmarshalJSON

Method UnmarshalJSON

server/store/types/types.go:676–682  ·  view source on GitHub ↗

UnmarshalJSON reads AccessMode from a quoted string.

(b []byte)

Source from the content-addressed store, hash-verified

674
675// UnmarshalJSON reads AccessMode from a quoted string.
676func (m *AccessMode) UnmarshalJSON(b []byte) error {
677 if b[0] != '"' || b[len(b)-1] != '"' {
678 return errors.New("syntax error")
679 }
680
681 return m.UnmarshalText(b[1 : len(b)-1])
682}
683
684// Scan is an implementation of sql.Scanner interface. It expects the
685// value to be a byte slice representation of an ASCII string.

Callers

nothing calls this directly

Calls 1

UnmarshalTextMethod · 0.95

Tested by

no test coverage detected