Commit 690ecb81 authored by astaxie's avatar astaxie

Merge pull request #353 from shxsun/master

initial utils dir
parents 4fa625de 830ccb66
package utils
import (
"os"
"path/filepath"
)
func SelfPath() string {
path, _ := filepath.Abs(os.Args[0])
return path
}
package utils
import (
"testing"
)
func TestSelfPath(t *testing.T) {
path := SelfPath()
if path == "" {
t.Error("path cannot be empty")
}
t.Logf("SelfPath: %s", path)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment