From 8916ff83988a2a4b76969dc4a08c2fb1aa5d2bd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arturo=20Filast=C3=B2?= Date: Thu, 27 Sep 2018 11:42:55 +0200 Subject: [PATCH] Add note about the testKeys extraction function --- internal/database/actions.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/database/actions.go b/internal/database/actions.go index 205fed1..00d911f 100644 --- a/internal/database/actions.go +++ b/internal/database/actions.go @@ -50,7 +50,12 @@ func GetResultTestKeys(sess sqlbuilder.Database, resultID int64) (string, error) if msmt.TestName == "web_connectivity" { break } - // We only really care about performance keys + // We only really care about performance keys. + // Note: since even in case of failure we still initialise an empty struct, + // it could be that these keys come out as initializes with the default + // values. + // XXX we may want to change this behaviour by adding `omitempty` to the + // struct definition. if msmt.TestName == "ndt" || msmt.TestName == "dash" { if err := json.Unmarshal([]byte(msmt.TestKeys), &tk); err != nil { log.WithError(err).Error("failed to parse testKeys")