Update Go API client
This commit is contained in:
parent
b5d36da2b6
commit
045f69d53a
|
@ -61,6 +61,12 @@ func Newest() (*Episode, error) {
|
|||
return getEpisode("/newest")
|
||||
}
|
||||
|
||||
// LastAired returns information on the most recently aried episode
|
||||
// or an error.
|
||||
func LastAired() (*Episode, error) {
|
||||
return getEpisode("/last_aired")
|
||||
}
|
||||
|
||||
// Random returns information on a random episode.
|
||||
func Random() (*Episode, error) {
|
||||
return getEpisode("/random")
|
||||
|
|
|
@ -11,6 +11,15 @@ func TestNewestEpisode(t *testing.T) {
|
|||
t.Logf("%#v", ep)
|
||||
}
|
||||
|
||||
func TestLastAiredEpisode(t *testing.T) {
|
||||
ep, err := LastAired()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
t.Logf("%#v", ep)
|
||||
}
|
||||
|
||||
func TestRandomEpisode(t *testing.T) {
|
||||
ep, err := Random()
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue