some code cleanup, fixed rustflags not being detected
This commit is contained in:
13
utils.go
13
utils.go
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user