mirror of https://github.com/jetkvm/kvm.git
fix lint errors
This commit is contained in:
parent
ed90e42324
commit
1f568c96dd
|
|
@ -26,7 +26,7 @@ func (a *IPAddress) Compare(n netlink.Addr) bool {
|
||||||
if !a.Address.IP.Equal(n.IP) {
|
if !a.Address.IP.Equal(n.IP) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if slices.Compare(a.Address.Mask, n.IPNet.Mask) != 0 {
|
if slices.Compare(a.Address.Mask, n.Mask) != 0 {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|
|
||||||
|
|
@ -258,4 +258,4 @@ func ToValidHostname(hostname string) string {
|
||||||
func ValidateHostname(hostname string) error {
|
func ValidateHostname(hostname string) error {
|
||||||
_, err := idna.Lookup.ToASCII(hostname)
|
_, err := idna.Lookup.ToASCII(hostname)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ func (c *Client) requestLease4(ifname string) (*Lease, error) {
|
||||||
}
|
}
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
|
||||||
// Prepend modifiers with default options, so they can be overriden.
|
// Prepend modifiers with default options, so they can be overridden.
|
||||||
reqmods := append(
|
reqmods := append(
|
||||||
[]dhcpv4.Modifier{
|
[]dhcpv4.Modifier{
|
||||||
dhcpv4.WithOption(dhcpv4.OptClassIdentifier(VendorIdentifier)),
|
dhcpv4.WithOption(dhcpv4.OptClassIdentifier(VendorIdentifier)),
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ func (c *Client) requestLease6(ifname string) (*Lease, error) {
|
||||||
}
|
}
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
|
|
||||||
// Prepend modifiers with default options, so they can be overriden.
|
// Prepend modifiers with default options, so they can be overridden.
|
||||||
reqmods := append(
|
reqmods := append(
|
||||||
[]dhcpv6.Modifier{
|
[]dhcpv6.Modifier{
|
||||||
dhcpv6.WithNetboot,
|
dhcpv6.WithNetboot,
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,9 @@ func (nm *NetlinkManager) monitorStateChange() {
|
||||||
updateCh := make(chan netlink.LinkUpdate)
|
updateCh := make(chan netlink.LinkUpdate)
|
||||||
// we don't need to stop the subscription, as it will be closed when the program exits
|
// we don't need to stop the subscription, as it will be closed when the program exits
|
||||||
stopCh := make(chan struct{}) //nolint:unused
|
stopCh := make(chan struct{}) //nolint:unused
|
||||||
netlink.LinkSubscribe(updateCh, stopCh)
|
if err := netlink.LinkSubscribe(updateCh, stopCh); err != nil {
|
||||||
|
nm.logger.Error().Err(err).Msg("failed to subscribe to link state changes")
|
||||||
|
}
|
||||||
|
|
||||||
nm.logger.Info().Msg("state change monitoring started")
|
nm.logger.Info().Msg("state change monitoring started")
|
||||||
|
|
||||||
|
|
@ -153,7 +155,7 @@ func (nm *NetlinkManager) EnsureInterfaceUpWithTimeout(ctx context.Context, ifac
|
||||||
|
|
||||||
linkUpTimeout := time.After(timeout)
|
linkUpTimeout := time.After(timeout)
|
||||||
|
|
||||||
attempt := 0
|
var attempt int
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
|
|
||||||
for {
|
for {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue