Skip to content

Commit

Permalink
Minor linting fixes
Browse files Browse the repository at this point in the history
Remove magic number (base10...)
  • Loading branch information
juanfont authored and kradalby committed Dec 6, 2022
1 parent 78819be commit 946d38e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
6 changes: 5 additions & 1 deletion cmd/headscale/cli/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import (
"google.golang.org/grpc/status"
)

const (
Base10 = 10
)

func init() {
rootCmd.AddCommand(routesCmd)
listRoutesCmd.Flags().Uint64P("identifier", "i", 0, "Node identifier (ID)")
Expand Down Expand Up @@ -204,7 +208,7 @@ func routesToPtables(routes []*v1.Route) pterm.TableData {
for _, route := range routes {
tableData = append(tableData,
[]string{
strconv.FormatUint(route.Id, 10),
strconv.FormatUint(route.Id, Base10),
route.Machine.GivenName,
route.Prefix,
strconv.FormatBool(route.Advertised),
Expand Down
10 changes: 0 additions & 10 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,16 +254,6 @@ func GrpcSocketDialer(ctx context.Context, addr string) (net.Conn, error) {
return d.DialContext(ctx, "unix", addr)
}

func ipPrefixToString(prefixes []netip.Prefix) []string {
result := make([]string, len(prefixes))

for index, prefix := range prefixes {
result[index] = prefix.String()
}

return result
}

func stringToIPPrefix(prefixes []string) ([]netip.Prefix, error) {
result := make([]netip.Prefix, len(prefixes))

Expand Down

0 comments on commit 946d38e

Please sign in to comment.