diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-08-16 13:41:12 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-08-16 13:41:12 +0200 |
| commit | de8b2adbcc4a39c359f3dd30249ac4ee225d4b9c (patch) | |
| tree | ba51a86a850e24bb54637becc7834a38c51d2429 /internal/discovery | |
| parent | fec6ea1eba9cee325bbd9d82aa71b8ebf5ef90b0 (diff) | |
Refactor: Use an interface for the data in the FSM callback
Diffstat (limited to 'internal/discovery')
| -rw-r--r-- | internal/discovery/discovery.go | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/internal/discovery/discovery.go b/internal/discovery/discovery.go index 733b446..79e7230 100644 --- a/internal/discovery/discovery.go +++ b/internal/discovery/discovery.go @@ -65,21 +65,14 @@ func (discovery *Discovery) DetermineOrganizationsUpdate() bool { return discovery.Organizations.Timestamp.IsZero() } -func (discovery *Discovery) GetSecureLocationList() (string, error) { +func (discovery *Discovery) GetSecureLocationList() []string { var locations []string for _, server := range discovery.Servers.List { if server.Type == "secure_internet" { locations = append(locations, server.CountryCode) } } - - jsonBytes, jsonErr := json.Marshal(locations) - - if jsonErr != nil { - return "", &types.WrappedErrorMessage{Message: "failed getting Secure Internet locations list", Err: jsonErr} - } - - return string(jsonBytes), nil + return locations } func (discovery *Discovery) GetServerByURL(url string, _type string) (*types.DiscoveryServer, error) { |
