Use markdown.Config as pointer everywhere

* As value mutex was copied and therefore synchronization worked wrong
* It's pretty big structure with reference types, so copying create unnecessary
  pressure on GC

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
Alexander Morozov
2015-09-10 15:12:46 -07:00
parent 55de037035
commit da7b9a6bbc
6 changed files with 20 additions and 20 deletions

View File

@ -21,8 +21,8 @@ func TestMarkdown(t *testing.T) {
md := Markdown{
Root: "./testdata",
FileSys: http.Dir("./testdata"),
Configs: []Config{
Config{
Configs: []*Config{
&Config{
Renderer: blackfriday.HtmlRenderer(0, "", ""),
PathScope: "/blog",
Extensions: []string{".md"},
@ -32,7 +32,7 @@ func TestMarkdown(t *testing.T) {
StaticDir: DefaultStaticDir,
StaticFiles: make(map[string]string),
},
Config{
&Config{
Renderer: blackfriday.HtmlRenderer(0, "", ""),
PathScope: "/log",
Extensions: []string{".md"},
@ -42,7 +42,7 @@ func TestMarkdown(t *testing.T) {
StaticDir: DefaultStaticDir,
StaticFiles: make(map[string]string),
},
Config{
&Config{
Renderer: blackfriday.HtmlRenderer(0, "", ""),
PathScope: "/og",
Extensions: []string{".md"},
@ -69,7 +69,7 @@ func TestMarkdown(t *testing.T) {
}
for i := range md.Configs {
c := &md.Configs[i]
c := md.Configs[i]
if err := GenerateStatic(md, c); err != nil {
t.Fatalf("Error: %v", err)
}
@ -221,7 +221,7 @@ Welcome to title!
w.Wait()
f = func() {
GenerateStatic(md, &md.Configs[0])
GenerateStatic(md, md.Configs[0])
w.Done()
}
for i := 0; i < 5; i++ {