From 8e7a25eacf715d7d83a8f10c84b03c68ea04a871 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Tue, 3 Jan 2023 12:37:00 +0100 Subject: Discovery: Remove server type from getting by country code It's always secure internet, no need to pass it as an argument --- internal/discovery/discovery.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal') diff --git a/internal/discovery/discovery.go b/internal/discovery/discovery.go index 7109bc9..b2a90cd 100644 --- a/internal/discovery/discovery.go +++ b/internal/discovery/discovery.go @@ -101,15 +101,15 @@ func (discovery *Discovery) ServerByURL( return nil, errors.Errorf("no server of type '%s' at URL '%s'", srvType, baseURL) } -// ServerByCountryCode returns the discovery server by the country code and the according type ("secure_internet", "institute_access") +// ServerByCountryCode returns the discovery server by the country code // An error is returned if and only if nil is returned for the server. -func (discovery *Discovery) ServerByCountryCode(countryCode string, srvType string) (*types.DiscoveryServer, error) { +func (discovery *Discovery) ServerByCountryCode(countryCode string) (*types.DiscoveryServer, error) { for _, srv := range discovery.servers.List { - if srv.CountryCode == countryCode && srv.Type == srvType { + if srv.CountryCode == countryCode && srv.Type == "secure_internet" { return &srv, nil } } - return nil, errors.Errorf("no server of type '%s' with country code '%s'", srvType, countryCode) + return nil, errors.Errorf("no server of type 'secure_internet' with country code '%s'", countryCode) } // orgByID returns the discovery organization by the organization ID -- cgit v1.2.3