690ecb81 by astaxie

Merge pull request #353 from shxsun/master

initial utils dir
2 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)
}
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!