Precompile port-filter regexp

This commit is contained in:
Cristian Maglie
2024-02-20 15:24:08 +01:00
parent bcd8695df4
commit 14e5ea68ce
5 changed files with 29 additions and 14 deletions

View File

@@ -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)\\..*")
const ioctlTcgetattr = unix.TIOCGETA
const ioctlTcsetattr = unix.TIOCSETA