@@ -32,9 +32,6 @@ func removeNonArduinoBoards(ports []OsSerialPort) []OsSerialPort {
32
32
//log.Println(string(cmdOutput))
33
33
cmdOutSlice := strings .Split (string (cmdOutput ), "\n " )
34
34
35
- var arduino_ports []OsSerialPort
36
- var other_ports []OsSerialPort
37
-
38
35
// how many lines is the output? boards attached = lines/8
39
36
for i := 0 ; i < len (cmdOutSlice )/ 8 ; i ++ {
40
37
@@ -62,22 +59,17 @@ func removeNonArduinoBoards(ports []OsSerialPort) []OsSerialPort {
62
59
if ! strings .Contains (port .Name , "/cu" ) {
63
60
port .RelatedNames = append (port .RelatedNames , archBoardName )
64
61
port .FriendlyName = strings .Trim (boardName , "\n " )
65
- arduino_ports = append (arduino_ports , port )
66
- } else {
67
- other_ports = append (other_ports , port )
68
62
}
69
63
}
70
64
}
71
65
}
72
66
73
- arduino_ports = append (arduino_ports , other_ports ... )
74
-
75
67
// additional remove phase
76
- arduino_ports = Filter (arduino_ports , func (port OsSerialPort ) bool {
68
+ ports = Filter (ports , func (port OsSerialPort ) bool {
77
69
return ! strings .Contains (port .Name , "Blue" ) && ! strings .Contains (port .Name , "/cu" )
78
70
})
79
71
80
- return arduino_ports
72
+ return ports
81
73
}
82
74
83
75
func getList () ([]OsSerialPort , os.SyscallError ) {
0 commit comments