File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -6,16 +6,27 @@ import (
66 "path/filepath"
77)
88
9- func GetTrdlBinaryPath () (string , error ) {
9+ var (
10+ trdlBinaryPath string
11+ errTrdlBinaryPath error
12+ )
13+
14+ func init () {
1015 exe , err := os .Executable ()
1116 if err != nil {
12- return "" , fmt .Errorf ("unable to determine trdl binary path: %w" , err )
17+ errTrdlBinaryPath = fmt .Errorf ("unable to determine trdl binary path: %w" , err )
18+ return
1319 }
1420
1521 realExe , err := filepath .EvalSymlinks (exe )
1622 if err != nil {
17- return "" , fmt .Errorf ("unable to resolve symlinks for %s: %w" , exe , err )
23+ trdlBinaryPath = exe
24+ return
1825 }
1926
20- return realExe , nil
27+ trdlBinaryPath = realExe
28+ }
29+
30+ func GetTrdlBinaryPath () (string , error ) {
31+ return trdlBinaryPath , errTrdlBinaryPath
2132}
You can’t perform that action at this time.
0 commit comments