Codebase list golang-gomega / 0df7b7f
Merge pull request #159 from WesleyJeanette/patch-1 Allow gexec.Build to be called concurrently Onsi Fakhouri authored 7 years ago GitHub committed 7 years ago
1 changed file(s) with 9 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
88 "path"
99 "path/filepath"
1010 "runtime"
11 "sync"
1112 )
1213
13 var tmpDir string
14 var (
15 mu sync.Mutex
16 tmpDir string
17 )
1418
1519 /*
1620 Build uses go build to compile the package at packagePath. The resulting binary is saved off in a temporary directory.
5963 gexec. In Ginkgo this is typically done in an AfterSuite callback.
6064 */
6165 func CleanupBuildArtifacts() {
66 mu.Lock()
67 defer mu.Unlock()
6268 if tmpDir != "" {
6369 os.RemoveAll(tmpDir)
6470 tmpDir = ""
6773
6874 func temporaryDirectory() (string, error) {
6975 var err error
76 mu.Lock()
77 defer mu.Unlock()
7078 if tmpDir == "" {
7179 tmpDir, err = ioutil.TempDir("", "gexec_artifacts")
7280 if err != nil {