Skip to content

Responses should just be a []byte #8

@parsnips

Description

@parsnips

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:

SynapseGo/read.go

Lines 7 to 17 in 7a3e060

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions