chore: use gofumpt for code formatting

This commit is contained in:
Quentin McGaw
2024-10-11 19:20:48 +00:00
parent 3daf15a612
commit 76a4bb5dc3
289 changed files with 784 additions and 548 deletions

View File

@@ -8,12 +8,11 @@ import (
"net/http"
)
var (
ErrHTTPStatusCodeNotOK = errors.New("HTTP status code not OK")
)
var ErrHTTPStatusCodeNotOK = errors.New("HTTP status code not OK")
func fetchAPI(ctx context.Context, client *http.Client,
limit uint) (data serversData, err error) {
limit uint,
) (data serversData, err error) {
url := "https://api.nordvpn.com/v2/servers"
url += fmt.Sprintf("?limit=%d", limit) // 0 means no limit

View File

@@ -175,7 +175,8 @@ var (
// wireguardPublicKey returns the Wireguard public key for the server.
func (s *serverData) wireguardPublicKey(technologies map[uint32]technologyData) (
wgPubKey string, err error) {
wgPubKey string, err error,
) {
for _, technology := range s.Technologies {
data, ok := technologies[technology.ID]
if !ok || data.Identifier != "wireguard_udp" {

View File

@@ -11,12 +11,11 @@ import (
"github.com/qdm12/gluetun/internal/provider/common"
)
var (
ErrNotIPv4 = errors.New("IP address is not IPv4")
)
var ErrNotIPv4 = errors.New("IP address is not IPv4")
func (u *Updater) FetchServers(ctx context.Context, minServers int) (
servers []models.Server, err error) {
servers []models.Server, err error,
) {
const limit = 0
data, err := fetchAPI(ctx, u.client, limit)
if err != nil {
@@ -47,7 +46,8 @@ func (u *Updater) FetchServers(ctx context.Context, minServers int) (
func extractServers(jsonServer serverData, groups map[uint32]groupData,
services map[uint32]serviceData, locations map[uint32]locationData,
technologies map[uint32]technologyData) (servers []models.Server,
warnings []string) {
warnings []string,
) {
ignoreReason := ""
switch {
case jsonServer.Status != "online":