MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / UnmarshalJSON

Method UnmarshalJSON

service/service_diff/type.go:10–19  ·  view source on GitHub ↗
(bytes []byte)

Source from the content-addressed store, hash-verified

8type ChangeType int
9
10func (c *ChangeType) UnmarshalJSON(bytes []byte) error {
11 var s string
12 err := json.Unmarshal(bytes, &s)
13 if err != nil {
14 return err
15 }
16 nv := ParseChangeType(s)
17 *c = nv
18 return nil
19}
20
21func (c *ChangeType) MarshalJSON() ([]byte, error) {
22 return json.Marshal(c.String())

Callers

nothing calls this directly

Calls 1

ParseChangeTypeFunction · 0.85

Tested by

no test coverage detected