1
0
дзеркало https://github.com/astaxie/beego.git synced 2025-07-13 09:21:01 +00:00
This commit is contained in:
skyblue
2013-12-09 13:30:19 +08:00
джерело 4fa625dea6
коміт 830ccb6660
2 змінених файлів з 24 додано та 0 видалено

11
utils/file.go Normal file

@ -0,0 +1,11 @@
package utils
import (
"os"
"path/filepath"
)
func SelfPath() string {
path, _ := filepath.Abs(os.Args[0])
return path
}

13
utils/file_test.go Normal file

@ -0,0 +1,13 @@
package utils
import (
"testing"
)
func TestSelfPath(t *testing.T) {
path := SelfPath()
if path == "" {
t.Error("path cannot be empty")
}
t.Logf("SelfPath: %s", path)
}