1package main 2 3import "time" 4 5func fixtureBlogCreate(i int) *Blog { 6 return &Blog{ 7 ID: 1 * i, 8 Title: "Title 1", 9 CreatedAt: time.Now(), 10 Posts: []*Post{ 11 { 12 ID: 1 * i, 13 Title: "Foo", 14 Body: "Bar", 15 Comments: []*Comment{ 16 { 17 ID: 1 * i, 18 Body: "foo", 19 }, 20 { 21 ID: 2 * i, 22 Body: "bar", 23 }, 24 }, 25 }, 26 { 27 ID: 2 * i, 28 Title: "Fuubar", 29 Body: "Bas", 30 Comments: []*Comment{ 31 { 32 ID: 1 * i, 33 Body: "foo", 34 }, 35 { 36 ID: 3 * i, 37 Body: "bas", 38 }, 39 }, 40 }, 41 }, 42 CurrentPost: &Post{ 43 ID: 1 * i, 44 Title: "Foo", 45 Body: "Bar", 46 Comments: []*Comment{ 47 { 48 ID: 1 * i, 49 Body: "foo", 50 }, 51 { 52 ID: 2 * i, 53 Body: "bar", 54 }, 55 }, 56 }, 57 } 58} 59 60func fixtureBlogsList() (blogs []interface{}) { 61 for i := 0; i < 10; i++ { 62 blogs = append(blogs, fixtureBlogCreate(i)) 63 } 64 65 return blogs 66} 67