Skip to content

Commit 9ca65b6

Browse files
authored
extract BelongsToCollection struct (#71)
1 parent bf64753 commit 9ca65b6

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

movies.go

+13-10
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,21 @@ import (
77
jsoniter "github.com/json-iterator/go"
88
)
99

10+
// BelongsToCollection type is a struct for a collection the movie is a part of.
11+
type BelongsToCollection struct {
12+
ID int64 `json:"id"`
13+
Name string `json:"name"`
14+
PosterPath string `json:"poster_path"`
15+
BackdropPath string `json:"backdrop_path"`
16+
}
17+
1018
// MovieDetails type is a struct for movie details JSON response.
1119
type MovieDetails struct {
12-
Adult bool `json:"adult"`
13-
BackdropPath string `json:"backdrop_path"`
14-
BelongsToCollection struct {
15-
ID int64 `json:"id"`
16-
Name string `json:"name"`
17-
PosterPath string `json:"poster_path"`
18-
BackdropPath string `json:"backdrop_path"`
19-
} `json:"belongs_to_collection"`
20-
Budget int64 `json:"budget"`
21-
Genres []struct {
20+
Adult bool `json:"adult"`
21+
BackdropPath string `json:"backdrop_path"`
22+
BelongsToCollection BelongsToCollection `json:"belongs_to_collection"`
23+
Budget int64 `json:"budget"`
24+
Genres []struct {
2225
ID int64 `json:"id"`
2326
Name string `json:"name"`
2427
} `json:"genres"`

0 commit comments

Comments
 (0)