From f4ea5b63f3539de1e2f08257db43cb2002ec65d0 Mon Sep 17 00:00:00 2001 From: Pacien Date: Mon, 1 Jul 2013 15:46:54 +0200 Subject: Fix go routines sync delays --- compiled.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'compiled.go') diff --git a/compiled.go b/compiled.go index 1cd391e..e7b7d0b 100644 --- a/compiled.go +++ b/compiled.go @@ -22,7 +22,6 @@ package main import ( "fmt" "os" - "time" ) func compiled(sourceDir, outputDir string, exts []string, saveAs string) { @@ -34,12 +33,10 @@ func compiled(sourceDir, outputDir string, exts []string, saveAs string) { } // compile everything + wait.Add(2) go compile(sourceDir, make(map[string][]byte), sourceDir, outputDir, saveAs, exts, true) go copyFiles(sourceDir, sourceDir, outputDir, exts, true) - // sleep some milliseconds to prevent early exit - time.Sleep(time.Millisecond * 100) - // wait until all tasks are completed wait.Wait() fmt.Println("Compilation done.") -- cgit v1.2.3