Skip to content

Commit 8064b50

Browse files
committed
fixup! chore: remove unused product_name
1 parent 7c500df commit 8064b50

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

pkg/board/board.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,14 @@ func identifyUnoQ(p *rpc.DetectedPort) {
8282
}
8383

8484
var onBoard = sync.OnceValue(func() bool {
85-
var boardNames = []string{"Imola\n", "Inc. Robotics RB1\n"}
86-
buf, err := os.ReadFile("/sys/class/dmi/id/product_name")
87-
if err == nil && slices.Contains(boardNames, string(buf)) {
88-
return true
85+
var boardNames = []string{
86+
"Imola", // code name for UNO Q
87+
}
88+
if buf, err := os.ReadFile("/sys/class/dmi/id/product_name"); err == nil {
89+
name := string(bytes.TrimSpace(buf))
90+
if slices.Contains(boardNames, name) {
91+
return true
92+
}
8993
}
9094
return false
9195
})()

0 commit comments

Comments
 (0)