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