Adding Stringer interface to Objects

This commit is contained in:
Christopher Herrera 2014-09-21 16:50:45 -04:00
parent c3798bd94c
commit 1a028dc2b9

View file

@ -187,3 +187,12 @@ func checkErrorStatus(status int) error {
return nil return nil
} }
} }
//Stringer Interface for MovieResult
func (mr MovieResult) String() string {
return fmt.Sprintf("#%s: %s (%s)", mr.ImdbID, mr.Title, mr.Year)
}
func (sr SearchResult) String() string {
return fmt.Sprintf("#%s: %s (%s) Type: %s", sr.ImdbId, sr.Title, sr.Year, sr.Type)
}