Skip to content

Commit

Permalink
Use uint64 instead of int64
Browse files Browse the repository at this point in the history
  • Loading branch information
akiomik committed Aug 4, 2022
1 parent 08e985c commit cea9b9e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
12 changes: 6 additions & 6 deletions export/csv.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ func ExportCsv(f *os.File, ch <-chan *twitter.AdaptiveJson) <-chan struct{} {
for j := range ch {
for _, k := range ReversedKeysOf(j.GlobalObjects.Tweets) {
t := j.GlobalObjects.Tweets[k]
u := j.GlobalObjects.Users[strconv.FormatInt(t.UserId, 10)]
u := j.GlobalObjects.Users[strconv.FormatUint(t.UserId, 10)]
r := []string{
strconv.FormatInt(t.Id, 10),
strconv.FormatUint(t.Id, 10),
u.ScreenName,
t.CreatedAt.Iso8601(),
t.FullText,
strconv.FormatInt(t.RetweetCount, 10),
strconv.FormatInt(t.FavoriteCount, 10),
strconv.FormatInt(t.ReplyCount, 10),
strconv.FormatInt(t.QuoteCount, 10),
strconv.FormatUint(t.RetweetCount, 10),
strconv.FormatUint(t.FavoriteCount, 10),
strconv.FormatUint(t.ReplyCount, 10),
strconv.FormatUint(t.QuoteCount, 10),
t.Geo,
t.Coodinates,
t.Lang,
Expand Down
26 changes: 13 additions & 13 deletions twitter/adaptive_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ type Place struct {
}

type Tweet struct {
Id int64 `json:"id"`
UserId int64 `json:"user_id"`
Id uint64 `json:"id"`
UserId uint64 `json:"user_id"`
FullText string `json:"full_text"`
RetweetCount int64 `json:"retweet_count"`
FavoriteCount int64 `json:"favorite_count"`
ReplyCount int64 `json:"reply_count"`
QuoteCount int64 `json:"quote_count"`
RetweetCount uint64 `json:"retweet_count"`
FavoriteCount uint64 `json:"favorite_count"`
ReplyCount uint64 `json:"reply_count"`
QuoteCount uint64 `json:"quote_count"`
Geo string `json:"geo"`
Coodinates string `json:"coordinates"`
Place Place `json:"place"`
Expand All @@ -51,18 +51,18 @@ type Tweet struct {
}

type User struct {
Id int64 `json:"id"`
Id uint64 `json:"id"`
Name string `json:"name"`
ScreenName string `json:"screen_name"`
Location string `json:"location"`
Description string `json:"description"`
Url string `json:"url"`
FollowersCount int64 `json:"followers_count"`
FriendsCount int64 `json:"friends_count"`
ListedCount int64 `json:"listed_count"`
FavouritesCount int64 `json:"favourites_count"`
StatusesCount int64 `json:"statuses_count"`
MediaCount int64 `json:"media_count"`
FollowersCount uint64 `json:"followers_count"`
FriendsCount uint64 `json:"friends_count"`
ListedCount uint64 `json:"listed_count"`
FavouritesCount uint64 `json:"favourites_count"`
StatusesCount uint64 `json:"statuses_count"`
MediaCount uint64 `json:"media_count"`
Verified bool `json:"verified"`
CreatedAt RubyDate `json:"created_at"`
}
Expand Down

0 comments on commit cea9b9e

Please sign in to comment.