MCPcopy
hub / github.com/minio/minio-go / UnmarshalJSON

Method UnmarshalJSON

pkg/set/intset.go:97–107  ·  view source on GitHub ↗

UnmarshalJSON - parses JSON data and creates new set with it.

(data []byte)

Source from the content-addressed store, hash-verified

95
96// UnmarshalJSON - parses JSON data and creates new set with it.
97func (set *IntSet) UnmarshalJSON(data []byte) error {
98 sl := []int{}
99 var err error
100 if err = json.Unmarshal(data, &sl); err == nil {
101 *set = make(IntSet)
102 for _, i := range sl {
103 set.Add(i)
104 }
105 }
106 return err
107}
108
109// String - returns printable string of the set.
110func (set IntSet) String() string {

Callers 3

TestIntSetUnmarshalJSONFunction · 0.95
TestIntSet_UnmarshalJSONFunction · 0.45

Calls 1

AddMethod · 0.95

Tested by 3

TestIntSetUnmarshalJSONFunction · 0.76
TestIntSet_UnmarshalJSONFunction · 0.36