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

12
bmd.go
View File

@@ -211,9 +211,9 @@ func (t *Tendrils) probeHyperDeck(ip net.IP) string {
}
response := string(buf[:n])
for _, line := range strings.Split(response, "\r\n") {
if strings.HasPrefix(line, "model: ") {
model := strings.TrimPrefix(line, "model: ")
for line := range strings.SplitSeq(response, "\r\n") {
if after, ok := strings.CutPrefix(line, "model: "); ok {
model := after
if t.DebugBMD {
log.Printf("[bmd] hyperdeck %s at %s", model, ip)
}
@@ -238,9 +238,9 @@ func (t *Tendrils) probeVideoHub(ip net.IP) string {
}
response := string(buf[:n])
for _, line := range strings.Split(response, "\n") {
if strings.HasPrefix(line, "Model name: ") {
model := strings.TrimSpace(strings.TrimPrefix(line, "Model name: "))
for line := range strings.SplitSeq(response, "\n") {
if after, ok := strings.CutPrefix(line, "Model name: "); ok {
model := strings.TrimSpace(after)
if t.DebugBMD {
log.Printf("[bmd] videohub %s at %s", model, ip)
}