mirror of
https://github.com/davegallant/vpngate.git
synced 2025-08-06 00:33:40 +00:00
Run gofumpt on the codebase (#58)
This commit is contained in:
@@ -2,13 +2,12 @@ package cmd
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"time"
|
||||
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/AlecAivazis/survey/v2"
|
||||
"github.com/rs/zerolog/log"
|
||||
@@ -17,8 +16,10 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var flagRandom bool
|
||||
var flagReconnect bool
|
||||
var (
|
||||
flagRandom bool
|
||||
flagReconnect bool
|
||||
)
|
||||
|
||||
func init() {
|
||||
connectCmd.Flags().BoolVarP(&flagRandom, "random", "r", false, "connect to a random server")
|
||||
@@ -32,9 +33,7 @@ var connectCmd = &cobra.Command{
|
||||
Long: `Connect to a vpn from a list of relay servers`,
|
||||
Args: cobra.RangeArgs(0, 1),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
||||
vpnServers, err := vpn.GetList()
|
||||
|
||||
if err != nil {
|
||||
log.Fatal().Msgf(err.Error())
|
||||
os.Exit(1)
|
||||
@@ -120,6 +119,5 @@ var connectCmd = &cobra.Command{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
|
@@ -20,9 +20,7 @@ var listCmd = &cobra.Command{
|
||||
Short: "List all available vpn servers",
|
||||
Args: cobra.NoArgs,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
||||
vpnServers, err := vpn.GetList()
|
||||
|
||||
if err != nil {
|
||||
log.Fatal().Msgf(err.Error())
|
||||
os.Exit(1)
|
||||
@@ -35,6 +33,5 @@ var listCmd = &cobra.Command{
|
||||
table.Append([]string{strconv.Itoa(i + 1), v.HostName, v.CountryLong, v.Ping, strconv.Itoa(v.Score)})
|
||||
}
|
||||
table.Render() // Send output
|
||||
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user