Apply go fix modernizations

This commit is contained in:
Ian Gulliver
2026-03-05 11:39:36 -08:00
parent 41f3602696
commit dd360b8e28
10 changed files with 57 additions and 60 deletions

View File

@@ -46,8 +46,8 @@ func extractNetaudioChanDevice(s string) string {
return ""
}
name := strings.ReplaceAll(s[:idx], "\\", "")
if atIdx := strings.Index(name, "@"); atIdx >= 0 {
return name[atIdx+1:]
if _, after, ok := strings.Cut(name, "@"); ok {
return after
}
return ""
}
@@ -235,7 +235,7 @@ func (t *Tendrils) sendMDNSQueries(ifaceName string, conn *net.UDPConn) {
dest := &net.UDPAddr{IP: net.IPv4(224, 0, 0, 251), Port: 5353}
n := len(mdnsServices)
for i := 0; i < n; i++ {
for i := range n {
service := mdnsServices[(i+mdnsQueryOffset)%n]
msg := new(dns.Msg)
msg.SetQuestion(service, dns.TypePTR)