I think the code would be clearer (and not unnecessarily copy the marshalled json a couple times) as

```go
if r.callback == "" { 
  resp.WriteHeader(http.StatusOK, "application/json")
  resp.Out.Write(b)
  return
}

resp.WriteHeader(http.StatusOK, "application/javascript")
resp.Out.Write([]byte(r.callback + "("))
resp.Out.Write(b) 
resp.Out.Write([]byte(");"))
```

thoughts?