Skip to content

Commit 1eac2aa

Browse files
committed
Add build/srcroot.go, a helper to interrogate module location.
1 parent bcdedbf commit 1eac2aa

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

build/srcroot.go

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package blst
2+
3+
import (
4+
"path/filepath"
5+
"runtime"
6+
)
7+
8+
var SrcRoot string
9+
10+
func init() {
11+
if _, self, _, ok := runtime.Caller(0); ok {
12+
SrcRoot = filepath.Dir(filepath.Dir(self))
13+
}
14+
}

0 commit comments

Comments
 (0)