Related to #7 Instead of using readStream to convert byte array into a map[string]interface, prefer just keeping the []byte such that clients can use json.Unmarshal into their own structs.
|
return readStream(response), err |
get rid of:
|
func readStream(data []byte) map[string]interface{} { |
|
d := make(map[string]interface{}) |
|
err := json.Unmarshal(data, &d) |
|
|
|
// if data is an empty stream this will cause an unmarshal error |
|
if err != nil { |
|
panic(err) |
|
} |
|
|
|
return d |
|
} |
Related to #7 Instead of using
readStreamto convert byte array into amap[string]interface, prefer just keeping the[]bytesuch that clients can usejson.Unmarshalinto their own structs.SynapseGo/users.go
Line 82 in 9d3ed7f
get rid of:
SynapseGo/read.go
Lines 7 to 17 in 7a3e060