updated util packages

This commit is contained in:
alexchao26
2020-12-10 01:04:51 -05:00
parent b9a74cf122
commit 1fec4f74d3
47 changed files with 285 additions and 95 deletions
-10
View File
@@ -3,7 +3,6 @@ package util
import (
"io/ioutil"
"path"
"path/filepath"
"runtime"
"strings"
)
@@ -31,12 +30,3 @@ func ReadFile(pathFromCaller string) string {
strContent := string(content)
return strings.TrimRight(strContent, "\n")
}
// Dirname is a port of __dirname in node
func Dirname() string {
_, filename, _, ok := runtime.Caller(1)
if !ok {
panic("getting calling function")
}
return filepath.Dir(filename)
}