]> 127.0.0.1 Git - part/.git/commitdiff
99
authorqydysky <qydysky@foxmail.com>
Sun, 10 Jan 2021 02:57:21 +0000 (10:57 +0800)
committerqydysky <qydysky@foxmail.com>
Sun, 10 Jan 2021 02:57:21 +0000 (10:57 +0800)
Exec.go
Reqf.go
get/Get.go

diff --git a/Exec.go b/Exec.go
index 0e0199f5c521fa72ddc23776e5ac8d11e0b3bbb5..32c66740914b713f06d718e23e3bec7198aac4fa 100644 (file)
--- a/Exec.go
+++ b/Exec.go
@@ -15,7 +15,7 @@ func (this *lexec) Run(hide bool,prog string,cmd ...string){
     Ppart.PRun(hide,prog,cmd ...)
 }
 
-func (this *lexec) Startf(pro ...*exec.Cmd){
+func (this *lexec) Start(pro ...*exec.Cmd){
     Ppart.PStartf(pro)
 }
 
diff --git a/Reqf.go b/Reqf.go
index 1990258a730a1350e4911b7a0b6bc6695db835fc..d7ebb27d63215bf2526151c61fcb08dc74c5c068 100644 (file)
--- a/Reqf.go
+++ b/Reqf.go
@@ -159,6 +159,7 @@ func (this *req) Reqf_1(val Rval) (error) {
         if _, err = io.Copy(out, Body); err != nil {out.Close();return err}
         out.Close()
 
+        if err = os.RemoveAll(filepath); err != nil {return err}
         if err = os.Rename(filepath+".dtmp", filepath); err != nil {return err}
         return nil
     }
index e9d1b1653fe78b7418987b9808347e8875ef5fa7..c8d8502ddbbd436835caf0efbf80526de3f94263 100644 (file)
@@ -62,25 +62,24 @@ func SS2(source,stratS,endS string) (return_val []string,last_err error) {
 func SS(source,stratS,endS string, startI,lenI int) (string,error) {
        if stratS == "" && startI == 0 {return "", errors.New("no symbol to start")}
        if endS == "" && lenI == 0 {return "", errors.New("no symbol to stop")}
-       s := source
 
        var ts,te int
 
        if stratS != "" {
-               if tmp := strings.Index(s, stratS);tmp != -1{ts = tmp + len(stratS)}
+               if tmp := strings.Index(source, stratS);tmp != -1{ts = tmp + len(stratS)}
        } else if startI != 0 {
-               if startI < len(s){ts = startI}
+               if startI < len(source){ts = startI}
        }
 
-       if ts == 0 {return "", errors.New("no start symbol "+ stratS +" in " + s)}
+       if ts == 0 {return "", errors.New("no start symbol "+ stratS +" in " + source)}
 
        if endS != "" {
-               if tmp := strings.Index(s[ts:], endS);tmp != -1{te = ts + tmp}
+               if tmp := strings.Index(source[ts:], endS);tmp != -1{te = ts + tmp}
        } else if lenI != 0 {
-               if startI + lenI < len(s){te = startI + lenI}
+               if startI + lenI < len(source){te = startI + lenI}
        }
 
-       if te == 0 {return "", errors.New("no stop symbol "+ endS +" in " + s)}
+       if te == 0 {return "", errors.New("no stop symbol "+ endS +" in " + source)}
 
-       return s[ts:te], nil
+       return source[ts:te], nil
 }