Added ProjectRoot computation
parent
e33b5b790f
commit
671c3d2b17
@ -0,0 +1,13 @@
|
||||
package file
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
var (
|
||||
_, b, _, _ = runtime.Caller(0)
|
||||
|
||||
// Root folder of this project
|
||||
ProjectRoot = filepath.Join(filepath.Dir(b), "..")
|
||||
)
|
||||
@ -0,0 +1,12 @@
|
||||
package file
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestProjectRoot(t *testing.T) {
|
||||
if !strings.Contains(ProjectRoot, "abrolgo") {
|
||||
t.Errorf("ProjectRoot is not correct: %s", ProjectRoot)
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue