From f69c52811c6aeb5fbbaf155e87baf4539601d8a7 Mon Sep 17 00:00:00 2001 From: Andinus Date: Sun, 15 Mar 2020 12:58:25 +0530 Subject: Fix url when media type is not an image --- cmd/cetus-nasa/cetus-nasa.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/cetus-nasa/cetus-nasa.go b/cmd/cetus-nasa/cetus-nasa.go index d90a08b..5f018cb 100644 --- a/cmd/cetus-nasa/cetus-nasa.go +++ b/cmd/cetus-nasa/cetus-nasa.go @@ -119,6 +119,10 @@ func printDetails(apodRes nasa.APOD) { fmt.Printf("Copyright: %s\n", apodRes.Copyright) fmt.Printf("Date: %s\n\n", apodRes.Date) fmt.Printf("Media Type: %s\n", apodRes.MediaType) - fmt.Printf("URL: %s\n\n", apodRes.HDURL) + if apodRes.MediaType == "image" { + fmt.Printf("URL: %s\n\n", apodRes.HDURL) + } else { + fmt.Printf("URL: %s\n\n", apodRes.HDURL) + } fmt.Printf("Explanation: %s\n", apodRes.Explanation) } -- cgit 1.4.1-2-gfad0 /option> My solutions for Exercism exercisesAndinus <andinus@nand.sh>
summary refs log tree commit diff stats
path: root/emacs-lisp/two-fer/README.md
blob: f60404af3be9ddb9451c5cf2b9eb634aaabe2fa2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19