From f75c53d4044127f5f9dccecd966bfd641a0c03cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arturo=20Filast=C3=B2?= Date: Fri, 29 Jun 2018 15:10:12 +0200 Subject: [PATCH] Fix summary package --- nettests/groups/groups.go | 8 ++++---- nettests/summary/summary.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nettests/groups/groups.go b/nettests/groups/groups.go index 06d6e67..b5e559c 100644 --- a/nettests/groups/groups.go +++ b/nettests/groups/groups.go @@ -27,7 +27,7 @@ var NettestGroups = map[string]NettestGroup{ websites.WebConnectivity{}, }, Summary: func(m summary.SummaryMap) (string, error) { - if err := checkRequiredKeys([]string{"WebConnectivity"}, m); err != nil { + if err := summary.CheckRequiredKeys([]string{"WebConnectivity"}, m); err != nil { log.WithError(err).Error("missing keys") return "", err } @@ -63,7 +63,7 @@ var NettestGroups = map[string]NettestGroup{ performance.NDT{}, }, Summary: func(m summary.SummaryMap) (string, error) { - if err := checkRequiredKeys([]string{"Dash", "Ndt"}, m); err != nil { + if err := summary.CheckRequiredKeys([]string{"Dash", "Ndt"}, m); err != nil { log.WithError(err).Error("missing keys") return "", err } @@ -102,7 +102,7 @@ var NettestGroups = map[string]NettestGroup{ middlebox.HTTPHeaderFieldManipulation{}, }, Summary: func(m summary.SummaryMap) (string, error) { - if err := checkRequiredKeys([]string{"WebConnectivity"}, m); err != nil { + if err := summary.CheckRequiredKeys([]string{"WebConnectivity"}, m); err != nil { log.WithError(err).Error("missing keys") return "", err } @@ -139,7 +139,7 @@ var NettestGroups = map[string]NettestGroup{ im.WhatsApp{}, }, Summary: func(m summary.SummaryMap) (string, error) { - if err := checkRequiredKeys([]string{"Whatsapp", "Telegram", "FacebookMessenger"}, m); err != nil { + if err := summary.CheckRequiredKeys([]string{"Whatsapp", "Telegram", "FacebookMessenger"}, m); err != nil { log.WithError(err).Error("missing keys") return "", err } diff --git a/nettests/summary/summary.go b/nettests/summary/summary.go index a7dabfe..f225927 100644 --- a/nettests/summary/summary.go +++ b/nettests/summary/summary.go @@ -33,7 +33,7 @@ type WebsitesSummary struct { Blocked uint } -func checkRequiredKeys(rk []string, m SummaryMap) error { +func CheckRequiredKeys(rk []string, m SummaryMap) error { for _, key := range rk { if _, ok := m[key]; ok { continue