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