@@ -19,7 +19,7 @@ type User struct {
1919
2020 // TalkPreviews is a list of TalkPreview objects, containing information about each talk
2121 // as seen on the user page
22- TalkPreviews TalkPreviews `json:"talkPreviews"`
22+ TalkPreviews [] TalkPreview `json:"talkPreviews"`
2323}
2424
2525// Author describes the SD profile of the person that's created the presentations
@@ -53,9 +53,6 @@ type TalkPreview struct {
5353 // Stars describes how many other users have starred this talk
5454 Stars uint32 `json:"stars"`
5555
56- // Date represents the talk presentation date
57- Date time.Time `json:"date"`
58-
5956 // Link describes the link to the talk at Speakerdeck
6057 Link string `json:"link"`
6158
@@ -75,6 +72,9 @@ type Talk struct {
7572 // TalkPreview is embedded here as it contains all the data we want to display here, too
7673 TalkPreview
7774
75+ // Date represents the talk presentation date
76+ Date time.Time `json:"date"`
77+
7878 // Author describes the Speakerdeck profile of the person that's created the presentations
7979 Author Author `json:"author"`
8080
@@ -124,24 +124,6 @@ func (p Talks) Swap(i, j int) {
124124 p [i ], p [j ] = p [j ], p [i ]
125125}
126126
127- // TalkPreviews orders the TalkPreview objects by time
128- type TalkPreviews []TalkPreview
129-
130- // Len implements sort.Interface
131- func (p TalkPreviews ) Len () int {
132- return len (p )
133- }
134-
135- // Less implements sort.Interface
136- func (p TalkPreviews ) Less (i , j int ) bool {
137- return p [i ].Date .Before (p [j ].Date )
138- }
139-
140- // Swap implements sort.Interface
141- func (p TalkPreviews ) Swap (i , j int ) {
142- p [i ], p [j ] = p [j ], p [i ]
143- }
144-
145127// Location describes a geographical location for the talk
146128// This struct is populated by the LocationExtension, and is set based on
147129// a "Location: <address>" string in the talk description. For instance,
0 commit comments