Skip to content

Commit

Permalink
Refactoring response struct
Browse files Browse the repository at this point in the history
  • Loading branch information
osamingo committed Feb 9, 2021
1 parent 71cfac6 commit 06cf9fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kenall.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type (
}
Option func(*Client)
Response struct {
Version *Version `json:"version"`
Version Version `json:"version"`
Addresses []*Address `json:"data"`
}
Version time.Time
Expand Down
5 changes: 4 additions & 1 deletion kenall_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,11 @@ func ExampleClient_Get() {
}

addr := res.Addresses[0]
fmt.Println(time.Time(res.Version).IsZero())
fmt.Println(addr.Prefecture, addr.City, addr.Town)
// Output: 東京都 千代田区 千代田
// Output:
// false
// 東京都 千代田区 千代田
}

func runTestingServer(t *testing.T) *httptest.Server {
Expand Down

0 comments on commit 06cf9fc

Please sign in to comment.