Run gofumpt on the codebase (#58)

This commit is contained in:
Dave G
2021-12-19 00:55:33 -05:00
committed by GitHub
parent 389400a974
commit 666cbee43a
6 changed files with 9 additions and 30 deletions

View File

@@ -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{
}
}
},
}

View File

@@ -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
},
}