diff --git a/file.go b/file.go index b0ef526..ba92701 100644 --- a/file.go +++ b/file.go @@ -132,7 +132,7 @@ func NewFilePages(dirname string, index bleve.Index) PagesRepository { } func convertBlocksToListItems(current string, blocks BlockResponse, indent int) []ActualListItem { - var listItems []ActualListItem + listItems := []ActualListItem{} for _, child := range blocks.Children[current] { l := convertBlocksToListItems(child, blocks, indent+1) @@ -350,7 +350,7 @@ func saveBlocksFromPage(dirname string, page Page) error { prevList[parent.ID] = parent blocks[parent.ID] = Block{ Text: title, - Children: nil, + Children: []string{}, Parent: root, }