mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-23 18:15:26 +00:00
Minor linting fixes
Remove magic number (base10...)
This commit is contained in:
parent
78819be03c
commit
946d38e5d7
@ -11,6 +11,10 @@ import (
|
|||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
Base10 = 10
|
||||||
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(routesCmd)
|
rootCmd.AddCommand(routesCmd)
|
||||||
listRoutesCmd.Flags().Uint64P("identifier", "i", 0, "Node identifier (ID)")
|
listRoutesCmd.Flags().Uint64P("identifier", "i", 0, "Node identifier (ID)")
|
||||||
@ -204,7 +208,7 @@ func routesToPtables(routes []*v1.Route) pterm.TableData {
|
|||||||
for _, route := range routes {
|
for _, route := range routes {
|
||||||
tableData = append(tableData,
|
tableData = append(tableData,
|
||||||
[]string{
|
[]string{
|
||||||
strconv.FormatUint(route.Id, 10),
|
strconv.FormatUint(route.Id, Base10),
|
||||||
route.Machine.GivenName,
|
route.Machine.GivenName,
|
||||||
route.Prefix,
|
route.Prefix,
|
||||||
strconv.FormatBool(route.Advertised),
|
strconv.FormatBool(route.Advertised),
|
||||||
|
10
utils.go
10
utils.go
@ -254,16 +254,6 @@ func GrpcSocketDialer(ctx context.Context, addr string) (net.Conn, error) {
|
|||||||
return d.DialContext(ctx, "unix", addr)
|
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) {
|
func stringToIPPrefix(prefixes []string) ([]netip.Prefix, error) {
|
||||||
result := make([]netip.Prefix, len(prefixes))
|
result := make([]netip.Prefix, len(prefixes))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user