Skip to content

Commit

Permalink
Fix ID type of report methods
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Whited <sam@samwhited.com>
  • Loading branch information
SamWhited authored and mattn committed Oct 25, 2024
1 parent b43f379 commit 1ef73e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions report.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

// Report holds information for a mastodon report.
type Report struct {
ID int64 `json:"id"`
ActionTaken bool `json:"action_taken"`
ID ID `json:"id"`
ActionTaken bool `json:"action_taken"`
}

// GetReports returns report of the current user.
Expand Down
8 changes: 4 additions & 4 deletions report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ func TestGetReports(t *testing.T) {
if len(rs) != 2 {
t.Fatalf("result should be two: %d", len(rs))
}
if rs[0].ID != 122 {
if rs[0].ID != "122" {
t.Fatalf("want %v but %v", 122, rs[0].ID)
}
if rs[1].ID != 123 {
if rs[1].ID != "123" {
t.Fatalf("want %v but %v", 123, rs[1].ID)
}
}
Expand Down Expand Up @@ -71,7 +71,7 @@ func TestReport(t *testing.T) {
if err != nil {
t.Fatalf("should not be fail: %v", err)
}
if rp.ID != 1234 {
if rp.ID != "1234" {
t.Fatalf("want %q but %q", "1234", rp.ID)
}
if rp.ActionTaken {
Expand All @@ -81,7 +81,7 @@ func TestReport(t *testing.T) {
if err != nil {
t.Fatalf("should not be fail: %v", err)
}
if rp.ID != 1234 {
if rp.ID != "1234" {
t.Fatalf("want %q but %q", "1234", rp.ID)
}
if !rp.ActionTaken {
Expand Down

0 comments on commit 1ef73e8

Please sign in to comment.