From 74e36f0ead717105f26087c2cab08b41ba5a7ce8 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Mon, 12 Feb 2024 19:18:05 +0100 Subject: All: Document everything to pass revive lint --- internal/discovery/discovery.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'internal/discovery') diff --git a/internal/discovery/discovery.go b/internal/discovery/discovery.go index 88a37d9..6db9425 100644 --- a/internal/discovery/discovery.go +++ b/internal/discovery/discovery.go @@ -27,6 +27,7 @@ type Discovery struct { ServerList discotypes.Servers `json:"servers"` } +// DiscoURL is the URL used for fetching the discovery files and signatures var DiscoURL = "https://disco.eduvpn.org/v2/" // file is a helper function that gets a disco JSON and fills the structure with it @@ -123,11 +124,12 @@ func (discovery *Discovery) ServerByURL( return nil, fmt.Errorf("no server of type '%s' at URL '%s'", srvType, baseURL) } -type CountryNotFoundError struct { +// ErrCountryNotFound is used when the secure internet country cannot be found +type ErrCountryNotFound struct { CountryCode string } -func (cnf *CountryNotFoundError) Error() string { +func (cnf *ErrCountryNotFound) Error() string { return fmt.Sprintf("no secure internet server with country code: '%s'", cnf.CountryCode) } @@ -139,7 +141,7 @@ func (discovery *Discovery) ServerByCountryCode(countryCode string) (*discotypes return &srv, nil } } - return nil, &CountryNotFoundError{CountryCode: countryCode} + return nil, &ErrCountryNotFound{CountryCode: countryCode} } // orgByID returns the discovery organization by the organization ID -- cgit v1.2.3