I\'m trying to return some json back from the server but get this error with the following code
cannot use buffer (type *bytes.Buffer) as type []byte in argument
This is how I solved my problem
readBuf, _ := ioutil.ReadAll(jsonStoredInBuffVariable)
This code will read from the buffer variable and output []byte value