MCPcopy Create free account
hub / github.com/redspread/spread / decodeObject

Function decodeObject

pkg/data/decode.go:34–44  ·  view source on GitHub ↗
(fields map[string]*pb.Field)

Source from the content-addressed store, hash-verified

32}
33
34func decodeObject(fields map[string]*pb.Field) (map[string]interface{}, error) {
35 out := make(map[string]interface{}, len(fields))
36 for k, field := range fields {
37 val, err := decodeField(field)
38 if err != nil {
39 return nil, fmt.Errorf("couldn't decode '%s': %v", field.Key, err)
40 }
41 out[k] = val
42 }
43 return out, nil
44}
45
46func decodeArray(fields []*pb.Field) ([]interface{}, error) {
47 out := make([]interface{}, len(fields))

Callers 1

decodeFieldFunction · 0.85

Calls 1

decodeFieldFunction · 0.85

Tested by

no test coverage detected