use any to replace interface{}

This commit is contained in:
Siyuan 2025-10-08 09:20:31 +00:00
parent aef26459d3
commit 17a15619ff
2 changed files with 5 additions and 5 deletions

View File

@ -153,14 +153,14 @@ func (c *Client) ensureInterfaceUp(ifname string) (*link.Link, error) {
return nlm.EnsureInterfaceUpWithTimeout(c.ctx, iface, c.cfg.LinkUpTimeout)
}
func (c *Client) sendInitialRequests() chan interface{} {
func (c *Client) sendInitialRequests() chan any {
return c.sendRequests(c.cfg.IPv4, c.cfg.IPv6)
}
func (c *Client) sendRequestsFamily(
family int,
wg *sync.WaitGroup,
r *chan interface{},
r *chan any,
l *zerolog.Logger,
iface *link.Link,
) {
@ -185,12 +185,12 @@ func (c *Client) sendRequestsFamily(
}(iface)
}
func (c *Client) sendRequests(ipv4, ipv6 bool) chan interface{} {
func (c *Client) sendRequests(ipv4, ipv6 bool) chan any {
c.mu.Lock()
defer c.mu.Unlock()
// Yeah, this is a hack, until we can cancel all leases in progress.
r := make(chan interface{}, 3*len(c.ifaces))
r := make(chan any, 3*len(c.ifaces))
var wg sync.WaitGroup
for _, iface := range c.ifaces {

View File

@ -133,7 +133,7 @@ func (rcm *ResolvConfManager) generateResolvConf(iface string, nameservers []net
}
var buf bytes.Buffer
if err := tmpl.Execute(&buf, map[string]interface{}{
if err := tmpl.Execute(&buf, map[string]any{
"iface": iface,
"nameservers": nameservers,
"searchList": searchList,