func respondWithMetric()

in metrics.go [82:91]


func respondWithMetric(w http.ResponseWriter, m Metric) {
	bodyString, err := json.Marshal(m)
	if err != nil {
		w.WriteHeader(http.StatusBadRequest)
		writeError(w, "unable to encode response", err)
		return
	}

	w.Write([]byte(bodyString))
}