code: func (s *HTTPServer) marshalJSON(req *http.Request, obj interface{}) ([]byte, error) {
  	if _, ok := req.URL.Query()["pretty"]; ok || s.agent.config.DevMode {
  		buf, err := json.MarshalIndent(obj, "", "    ")
  		if err != nil {
  			return nil, err
  		}
  		buf = append(buf, "\n"...)
  		return buf, nil
  	}
  
  	buf, err := json.Marshal(obj)
  	if err != nil {
  		return nil, err
  	}
  	return buf, err
  }
docs: // marshalJSON marshals the object into JSON, respecting the user's pretty-ness
  // configuration.