code: func unmarshal(resp *http.Response, v interface{}) error {
  	defer resp.Body.Close()
  
  	// Don't Unmarshal Body if v is nil
  	if v == nil {
  		return nil
  	}
  
  	ctype, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
  	if err != nil {
  		return err
  	}
  
  	if !isJSONContentType(ctype) {
  		return fmt.Errorf("unexpected response: %s %s", resp.Status, ctype)
  	}
  
  	return json.NewDecoder(resp.Body).Decode(v)
  }
docs: // unmarshal unmarshals a JSON object from the response object's body. If the
  // Content-Type is not application/json or application/vnd* (or we can't detect
  // the media type) an error is returned. The response body is always closed.