blob: a08766508bd5cb90badceee1ef4192980b1e30da (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
package apod
import (
"fmt"
)
// Print will print the json output
func Print(res Res) {
fmt.Printf("Title: %s\n\n", res.Title)
fmt.Printf("Copyright: %s\n", res.Copyright)
fmt.Printf("Date: %s\n\n", res.Date)
fmt.Printf("Media Type: %s\n", res.MediaType)
if res.MediaType == "image" {
fmt.Printf("URL: %s\n\n", res.HDURL)
} else {
fmt.Printf("URL: %s\n\n", res.URL)
}
fmt.Printf("Explanation: %s\n", res.Explanation)
}
|