()
| 6 | ) |
| 7 | |
| 8 | func ExampleData() Blog { |
| 9 | profileJohn := UserProfile{ |
| 10 | Birthday: time.Date(1990, 1, 1, 0, 0, 0, 0, time.UTC), |
| 11 | Biography: "A passionate writer about Go.", |
| 12 | Website: "https://johndoe.com", |
| 13 | } |
| 14 | |
| 15 | profileJane := UserProfile{ |
| 16 | Birthday: time.Date(1985, 2, 15, 0, 0, 0, 0, time.UTC), |
| 17 | Biography: "A web developer and writer.", |
| 18 | Website: "https://jane.com", |
| 19 | } |
| 20 | |
| 21 | authorJohn := Author{ |
| 22 | ID: 1, |
| 23 | FirstName: "John", |
| 24 | LastName: "Doe", |
| 25 | Email: "john.doe@example.com", |
| 26 | Profile: profileJohn, |
| 27 | } |
| 28 | |
| 29 | authorJane := Author{ |
| 30 | ID: 2, |
| 31 | FirstName: "Jane", |
| 32 | LastName: "Smith", |
| 33 | Email: "jane.smith@example.com", |
| 34 | Profile: profileJane, |
| 35 | } |
| 36 | |
| 37 | posts := []Post{ |
| 38 | { |
| 39 | ID: 1, |
| 40 | Title: "Understanding Golang", |
| 41 | Content: "Go is an open-source programming language...", |
| 42 | PublishDate: time.Now().AddDate(0, -1, 0), |
| 43 | Author: authorJohn, |
| 44 | Comments: generateComments(3), |
| 45 | Tags: []string{"Go", "Programming"}, |
| 46 | Likes: 100, |
| 47 | }, |
| 48 | { |
| 49 | ID: 2, |
| 50 | Title: "Exploring Python", |
| 51 | Content: "Python is versatile...", |
| 52 | PublishDate: time.Now().AddDate(0, -2, 0), |
| 53 | Author: authorJane, |
| 54 | Comments: generateComments(4), |
| 55 | Tags: []string{"Python", "Development"}, |
| 56 | Likes: 150, |
| 57 | }, |
| 58 | { |
| 59 | ID: 3, |
| 60 | Title: "Web Development Basics", |
| 61 | Content: "The world of web development...", |
| 62 | PublishDate: time.Now().AddDate(0, -3, 0), |
| 63 | Author: authorJane, |
| 64 | Comments: generateComments(5), |
| 65 | Tags: []string{"Web", "HTML", "CSS"}, |
nothing calls this directly
no test coverage detected
searching dependent graphs…