Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Responses should just be a []byte #8

Open
parsnips opened this issue Apr 1, 2019 · 2 comments
Open

Responses should just be a []byte #8

parsnips opened this issue Apr 1, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@parsnips
Copy link
Contributor

parsnips commented Apr 1, 2019

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
}

@nathanpanics nathanpanics added the enhancement New feature or request label Apr 1, 2019
@evilfrog
Copy link

Generally: using proper return types would be 👍
These map[string]interface{} is driving me nuts 😄

@nathanpanics
Copy link
Contributor

Update: Currently testing branch v0.1.0 which implements this enhancement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants