Using a composite literal to create a page.

Wonder why the need for composite structs.  Not sure if my go knowledge is lacking or if this is cruft from other programming language doctrine.
This commit is contained in:
Noah Campbell 2013-08-03 10:52:40 -07:00
parent 19538a1bd6
commit 0595f27e6d

View file

@ -77,14 +77,13 @@ func (p Pages) Sort() { sort.Sort(p) }
func (p Pages) Limit(n int) Pages { return p[0:n] }
func initializePage(filename string) (page Page) {
page = Page{}
page = Page{contentType: "",
File: File{FileName: filename,
Extension: "html"},
Params: make(map[string]interface{}),
Node: Node{Keywords: make([]string, 10, 30)},
Markup: "md"}
page.Date, _ = time.Parse("20060102", "20080101")
page.FileName = filename
page.contentType = ""
page.Extension = "html"
page.Params = make(map[string]interface{})
page.Keywords = make([]string, 10, 30)
page.Markup = "md"
page.setSection()
return page