Update module github.com/olekukonko/tablewriter to v1 (#155)

* Update module github.com/olekukonko/tablewriter to v1

* Fix lint

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Dave Gallant <davegallant@proton.me>
This commit is contained in:
renovate[bot]
2026-02-13 22:06:53 -05:00
committed by GitHub
parent 7da150493c
commit 34054180ed
3 changed files with 40 additions and 44 deletions

View File

@@ -4,7 +4,7 @@ import (
"os"
"strconv"
"github.com/olekukonko/tablewriter"
tw "github.com/olekukonko/tablewriter"
"github.com/rs/zerolog/log"
"github.com/davegallant/vpngate/pkg/vpn"
@@ -30,12 +30,20 @@ var listCmd = &cobra.Command{
os.Exit(1)
}
table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"#", "HostName", "Country", "Ping", "Score"})
table := tw.NewWriter(os.Stdout)
table.Header([]string{"#", "HostName", "Country", "Ping", "Score"})
for i, v := range *vpnServers {
table.Append([]string{strconv.Itoa(i + 1), v.HostName, v.CountryLong, v.Ping, strconv.Itoa(v.Score)})
err := table.Append([]string{strconv.Itoa(i + 1), v.HostName, v.CountryLong, v.Ping, strconv.Itoa(v.Score)})
if err != nil {
log.Fatal().Msg(err.Error())
os.Exit(1)
}
}
err = table.Render()
if err != nil {
log.Fatal().Msg(err.Error())
os.Exit(1)
}
table.Render() // Send output
},
}