Use Runtime type instead of int32 in our Movie struct.
All checks were successful
Deploy Greenlight API / deploy (push) Successful in 54s

This commit is contained in:
Maxime Delporte
2025-10-21 16:29:11 +02:00
parent cc588a1dc0
commit bc21c4cf87
2 changed files with 7 additions and 7 deletions

View File

@@ -14,10 +14,7 @@ type Runtime int32
// MarshalJSON
/*
Implement a MarshalJSON() method on the Runtime type so that it satisfies
the json.Marshaler interface. This should return the JSON-encoded value
for the movie runtime (in our case, it will return string in the format
"<runtime> mins").
Implement a MarshalJSON() method on the Runtime type so that it satisfies the json.Marshaler interface. This should return the JSON-encoded value for the movie runtime (in our case, it will return string in the format "<runtime> mins").
*/
func (r Runtime) MarshalJSON() ([]byte, error) {
// Generate a string containing the movie runtime in the required format.