chore: use gofumpt for code formatting
This commit is contained in:
@@ -12,7 +12,8 @@ import (
|
||||
)
|
||||
|
||||
func (u *Updater) FetchServers(ctx context.Context, minServers int) (
|
||||
servers []models.Server, err error) {
|
||||
servers []models.Server, err error,
|
||||
) {
|
||||
hostToData, err := fetchServers(ctx, u.client)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("fetching and parsing website: %w", err)
|
||||
|
||||
@@ -13,7 +13,8 @@ type Updater struct {
|
||||
}
|
||||
|
||||
func New(client *http.Client, warner common.Warner,
|
||||
parallelResolver common.ParallelResolver) *Updater {
|
||||
parallelResolver common.ParallelResolver,
|
||||
) *Updater {
|
||||
return &Updater{
|
||||
client: client,
|
||||
parallelResolver: parallelResolver,
|
||||
|
||||
@@ -12,7 +12,8 @@ import (
|
||||
)
|
||||
|
||||
func fetchServers(ctx context.Context, client *http.Client) (
|
||||
hostToData map[string]serverData, err error) {
|
||||
hostToData map[string]serverData, err error,
|
||||
) {
|
||||
const url = "https://www.slickvpn.com/locations/"
|
||||
rootNode, err := htmlutils.Fetch(ctx, client, url)
|
||||
if err != nil {
|
||||
@@ -133,9 +134,7 @@ func matchA(cellNode *html.Node) (match bool) {
|
||||
|
||||
var serverNameRegex = regexp.MustCompile(`^.+\/(?P<serverName>.+)\.ovpn$`)
|
||||
|
||||
var (
|
||||
ErrExtractHostnameFromURL = errors.New("cannot extract hostname from url")
|
||||
)
|
||||
var ErrExtractHostnameFromURL = errors.New("cannot extract hostname from url")
|
||||
|
||||
func extractHostnameFromURL(url string) (hostname string, err error) {
|
||||
matches := serverNameRegex.FindStringSubmatch(url)
|
||||
|
||||
Reference in New Issue
Block a user