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 = "^(cu|tty)\\..*"
|
||||
|
||||
var osPortFiler = regexp.MustCompile("^(cu|tty)\\..*")
|
||||
|
||||
// termios manipulation functions
|
||||
|
||||
|
||||
Reference in New Issue
Block a user