Hi Shane,

This doesn't happen with your example: https://play.golang.org/p/C3zb6Qyx-2f

Can you provide a small example of when it does happen?

//jb

On 6 Apr 2020, at 08:03, Shane H 
<shane....@gmail.com<mailto:shane....@gmail.com>> wrote:

I know that it's documented that the json encoder will produce base64 "Array 
and slice values encode as JSON arrays, except that []byte encodes as a 
base64-encoded string", but I am getting a base64 response when I pass in a 
string

response := []string
response = append(response, 
"http://localhost:10000/obscured/media/f7/c3/e6/a74f71b64712bf11af31b2d027dadbe41f63313103d14a528043d66173";)

w.WriteHeader(http.StatusCreated)
if err := json.NewEncoder(w).Encode(response); err != nil{
    // handle error
}

Will produce the base64 equivalent of the URL, instead of json.

Given that every time I have asked for help on this list I have discovered that 
it's something that I am doing wrong, I do NOT mind if someone helpfully points 
me toward the documentation I am misreading

--
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
golang-nuts+unsubscr...@googlegroups.com<mailto:golang-nuts+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/4e145a21-52cb-4393-bda0-b11d11a471ed%40googlegroups.com<https://groups.google.com/d/msgid/golang-nuts/4e145a21-52cb-4393-bda0-b11d11a471ed%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/0349A14F-DC57-4217-8F4E-F27087067CFC%40kastelo.net.

Reply via email to