MCPcopy Index your code
hub / github.com/koding/kite / SliceOfLength

Method SliceOfLength

dnode/partial.go:70–81  ·  view source on GitHub ↗

SliceOfLength is a helper method to unmarshal a JSON Array with specified length.

(length int)

Source from the content-addressed store, hash-verified

68
69// SliceOfLength is a helper method to unmarshal a JSON Array with specified length.
70func (p *Partial) SliceOfLength(length int) (a []*Partial, err error) {
71 err = p.Unmarshal(&a)
72 if err != nil {
73 return
74 }
75
76 if len(a) != length {
77 err = errors.New("Invalid array length")
78 }
79
80 return
81}
82
83// Map is a helper method to unmarshal to a JSON Object.
84func (p *Partial) Map() (m map[string]*Partial, err error) {

Callers 3

MustSliceOfLengthMethod · 0.95
newHeartbeatReqFunction · 0.80
makeResponseCallbackMethod · 0.80

Calls 1

UnmarshalMethod · 0.95

Tested by

no test coverage detected