From dd4fbc4cf8f8bbcea5127154e504358972d70b2e Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Mon, 19 Oct 2015 14:30:13 -0700 Subject: [PATCH] Add notes to "compare" results Fixes #22. --- api/compare.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/compare.go b/api/compare.go index 687a841..cfb728c 100644 --- a/api/compare.go +++ b/api/compare.go @@ -57,7 +57,11 @@ func HandleCompare(w http.ResponseWriter, r *http.Request) *types.AppError { strainIDInt, _ := strconv.ParseInt(strainID, 10, 0) for _, m := range *measurementsPayload.Measurements { if (m.CharacteristicID == characteristicIDInt) && (m.StrainID == strainIDInt) { - values[strainID] = m.Value() + if m.Notes.Valid { + values[strainID] = fmt.Sprintf("%s (%s)", m.Value(), m.Notes.String) + } else { + values[strainID] = m.Value() + } } } // If the strain doesn't have a measurement for this characteristic,