Skip to content

Commit dda2655

Browse files
committed
Fix score field: LW returns float64, cast to int for display
1 parent 2661d9f commit dda2655

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lesswrong/types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ type lwPost struct {
2727
URL string `json:"url"`
2828
PageURL string `json:"pageUrl"`
2929
PostedAt string `json:"postedAt"`
30-
Score int `json:"score"`
31-
BaseScore int `json:"baseScore"`
30+
Score float64 `json:"score"`
31+
BaseScore float64 `json:"baseScore"`
3232
CommentCount int `json:"commentCount"`
3333
WordCount int `json:"wordCount"`
3434
VoteCount int `json:"voteCount"`
@@ -95,7 +95,7 @@ func wireToPost(p lwPost, rank int) Post {
9595
Rank: rank,
9696
Title: p.Title,
9797
Author: author,
98-
Score: p.Score,
98+
Score: int(p.Score),
9999
Comments: p.CommentCount,
100100
Words: p.WordCount,
101101
Tags: tags,

0 commit comments

Comments
 (0)