package main type VpnProvider interface { ServerList() (error, *map[string]string) } func (s *OpenVpnMgt) getServerList(provider string) error { var err error s.Lock() defer s.Unlock() if _, ok := s.VpnRemotes[provider]; ok { return nil } switch provider { case "dailymotion": list := DailymotionVPN{} err, s.VpnRemotes[provider] = list.ServerList() return err case "expressvpn": list := ExpressVPN{} err, s.VpnRemotes[provider] = list.ServerList() return err } return nil }