]> 127.0.0.1 Git - part/.git/commitdiff
49
authorqydysky <qydysky@foxmail.com>
Sat, 15 Aug 2020 04:19:19 +0000 (12:19 +0800)
committerqydysky <qydysky@foxmail.com>
Sat, 15 Aug 2020 04:19:19 +0000 (12:19 +0800)
Sys.go

diff --git a/Sys.go b/Sys.go
index 23ca6688cf5ed3693cf7cbfbd10b9a52b756fb6e..13388e0f57a95ce8450efc12a171a07eff09de3a 100644 (file)
--- a/Sys.go
+++ b/Sys.go
@@ -17,7 +17,10 @@ import (
        Ppart "github.com/qydysky/part/linuxwin"
 )
 
-type sys struct {sync.Mutex}
+type sys struct {
+       RV []interface{}
+       sync.Mutex
+}
 
 func Sys () *sys {
        return &sys{}
@@ -34,7 +37,7 @@ func (this *sys) Cdir()string{
 
 func (t *sys) Pdir(cdir string) string{
        var s string = "/"
-       if t.GetSys("windwos") {
+       if t.GetSys("windows") {
                s = "\\"
        }
        if p := strings.LastIndex(cdir, s);p == -1 {
@@ -45,6 +48,12 @@ func (t *sys) Pdir(cdir string) string{
        return cdir
 }
 
+func GetRV(i *[]interface{},num int) []interface{} {
+       p := (*i)[:num]
+       (*i) = append((*i)[num:])
+       return p
+}
+
 func (this *sys) Timeoutf(Timeout int) {
        this.Lock()
        defer this.Unlock()
@@ -53,9 +62,7 @@ func (this *sys) Timeoutf(Timeout int) {
 }
 
 func (this *sys) GetSys(sys string)bool{
-       this.Lock()
-       defer this.Unlock()
-
+       this.RV = append(this.RV, runtime.GOOS)
     return runtime.GOOS==sys
 }