Precompile port-filter regexp
This commit is contained in:
@@ -6,10 +6,15 @@
|
||||
|
||||
package serial
|
||||
|
||||
import "golang.org/x/sys/unix"
|
||||
import (
|
||||
"regexp"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
const devFolder = "/dev"
|
||||
const regexFilter = "(ttyS|ttyHS|ttyUSB|ttyACM|ttyAMA|rfcomm|ttyO|ttymxc)[0-9]{1,3}"
|
||||
|
||||
var osPortFilter = regexp.MustCompile("(ttyS|ttyHS|ttyUSB|ttyACM|ttyAMA|rfcomm|ttyO|ttymxc)[0-9]{1,3}")
|
||||
|
||||
// termios manipulation functions
|
||||
|
||||
|
||||
Reference in New Issue
Block a user