Markdown: Modify development mode to generate links on page requests.

This commit is contained in:
Abiola Ibrahim
2015-08-05 00:41:04 +01:00
parent 851026d3fa
commit 2ab466599d
5 changed files with 37 additions and 37 deletions

View File

@ -199,7 +199,7 @@ func getTrue() bool {
}
}
// attempt to trigger race condition
// attempt to trigger race conditions
var w sync.WaitGroup
f := func() {
req, err := http.NewRequest("GET", "/log/test.md", nil)
@ -217,6 +217,16 @@ func getTrue() bool {
}
w.Wait()
f = func() {
GenerateLinks(md, &md.Configs[0])
w.Done()
}
for i := 0; i < 5; i++ {
w.Add(1)
go f()
}
w.Wait()
if err = os.RemoveAll(DefaultStaticDir); err != nil {
t.Errorf("Error while removing the generated static files: %v", err)
}