GetProjectDir returns the correct absolute path of this project.
()
| 9 | |
| 10 | // GetProjectDir returns the correct absolute path of this project. |
| 11 | func GetProjectDir() string { |
| 12 | _, f, _, _ := runtime.Caller(0) |
| 13 | projectDir, _ := filepath.Abs(path.Join(filepath.Dir(f), "../")) |
| 14 | return projectDir |
| 15 | } |
| 16 | |
| 17 | // WithWd executes a function with the specified working directory. |
| 18 | func WithWd(chDir string, f func(origWd string)) { |
no outgoing calls
searching dependent graphs…