some code cleanup, fixed rustflags not being detected

This commit is contained in:
2023-01-20 13:18:34 +01:00
parent 4431e906c3
commit c2dec11aaf
4 changed files with 2 additions and 27 deletions

View File

@@ -24,7 +24,6 @@ import (
"strconv"
"strings"
"sync"
"syscall"
"time"
)
@@ -45,7 +44,7 @@ const (
)
var (
reVar = regexp.MustCompile(`(?mU)^#?[^\S\r\n]*(\w+)[^\S\r\n]*=[^\S\r\n]*([("])([^)"]+)([)"])[^\S\r\n]*$`)
reVar = regexp.MustCompile(`(?mU)^#?[^\S\r\n]*(\w+)[^\S\r\n]*=[^\S\r\n]*([("])([^)"]*)([)"])[^\S\r\n]*$`)
reEnvClean = regexp.MustCompile(`(?m) ([\s\\]+) `)
rePkgRel = regexp.MustCompile(`(?m)^pkgrel\s*=\s*(.+)$`)
rePkgSource = regexp.MustCompile(`(?msU)^source.*=.*\((.+)\)$`)
@@ -1011,13 +1010,3 @@ func (globs Globs) Expand() ([]string, error) {
return matches, nil
}
func TotalMemory() uint64 {
sinfo := new(syscall.Sysinfo_t)
err := syscall.Sysinfo(sinfo)
if err != nil {
return 0
}
return sinfo.Totalram * uint64(sinfo.Unit)
}