]> 127.0.0.1 Git - part/.git/commitdiff
62
authorqydysky <qydysky@foxmail.com>
Thu, 17 Sep 2020 07:15:11 +0000 (15:15 +0800)
committerqydysky <qydysky@foxmail.com>
Thu, 17 Sep 2020 07:15:11 +0000 (15:15 +0800)
Sys.go

diff --git a/Sys.go b/Sys.go
index 8d48e377c30a1fe928f24c8218af42d55d1228ad..377c9c2b1ecd8b3127b3fa93ec2bb3b6345e0370 100644 (file)
--- a/Sys.go
+++ b/Sys.go
@@ -1,6 +1,7 @@
 package part
 
 import (
+       "fmt"
        "sync"
     "path/filepath"
        "os"
@@ -26,6 +27,14 @@ func Sys () *sys {
        return &sys{}
 }
 
+func (*sys) Type(s ...interface{}) string {
+       if len(s) == 0{return "nil"}
+       switch t := s[0].(type) {
+       default:return fmt.Sprintf("%T", t)
+       }
+       return ""
+}
+
 func (this *sys) Cdir()string{
        this.Lock()
        defer this.Unlock()