Apply go fix modernizations
This commit is contained in:
6
mdns.go
6
mdns.go
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user