Change CreatedAt fields to time.Time
authorMikael Berthe <mikael@lilotux.net>
Tue, 18 Apr 2017 19:31:42 +0200
changeset 136 1af0a6199a93
parent 135 c578c80ed882
child 137 acaea3179f4d
Change CreatedAt fields to time.Time
types.go
--- a/types.go	Mon Apr 17 19:31:59 2017 +0200
+++ b/types.go	Tue Apr 18 19:31:42 2017 +0200
@@ -30,19 +30,19 @@
 
 // Account represents a Mastodon account entity
 type Account struct {
-	ID             int    `json:"id"`
-	Username       string `json:"username"`
-	Acct           string `json:"acct"`
-	DisplayName    string `json:"display_name"`
-	Note           string `json:"note"`
-	URL            string `json:"url"`
-	Avatar         string `json:"avatar"`
-	Header         string `json:"header"`
-	Locked         bool   `json:"locked"`
-	CreatedAt      string `json:"created_at"`
-	FollowersCount int    `json:"followers_count"`
-	FollowingCount int    `json:"following_count"`
-	StatusesCount  int    `json:"statuses_count"`
+	ID             int       `json:"id"`
+	Username       string    `json:"username"`
+	Acct           string    `json:"acct"`
+	DisplayName    string    `json:"display_name"`
+	Note           string    `json:"note"`
+	URL            string    `json:"url"`
+	Avatar         string    `json:"avatar"`
+	Header         string    `json:"header"`
+	Locked         bool      `json:"locked"`
+	CreatedAt      time.Time `json:"created_at"`
+	FollowersCount int       `json:"followers_count"`
+	FollowingCount int       `json:"following_count"`
+	StatusesCount  int       `json:"statuses_count"`
 }
 
 // Application represents a Mastodon application entity
@@ -98,11 +98,11 @@
 
 // Notification represents a Mastodon notification entity
 type Notification struct {
-	ID        int      `json:"id"`
-	Type      string   `json:"type"`
-	CreatedAt string   `json:"created_at"`
-	Account   *Account `json:"account"`
-	Status    *Status  `json:"status"`
+	ID        int       `json:"id"`
+	Type      string    `json:"type"`
+	CreatedAt time.Time `json:"created_at"`
+	Account   *Account  `json:"account"`
+	Status    *Status   `json:"status"`
 }
 
 // Relationship represents a Mastodon relationship entity