From c1e489fbd281698b262d3114b08f875b1ff3b966 Mon Sep 17 00:00:00 2001 From: Andinus Date: Sun, 15 Mar 2020 13:30:18 +0530 Subject: Handle if block within printDetails function --- cmd/cetus-nasa/cetus-nasa.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'cmd/cetus-nasa') diff --git a/cmd/cetus-nasa/cetus-nasa.go b/cmd/cetus-nasa/cetus-nasa.go index d462455..801a89f 100644 --- a/cmd/cetus-nasa/cetus-nasa.go +++ b/cmd/cetus-nasa/cetus-nasa.go @@ -69,9 +69,7 @@ func main() { log.Fatal(err) } - if !quiet { - printDetails(apodRes) - } + printDetails(apodRes) // if fetchOnly is true then don't set background if fetchOnly { @@ -110,6 +108,9 @@ func parseFlags() { } func printDetails(apodRes nasa.APOD) { + if quiet { + return + } fmt.Printf("Title: %s\n\n", apodRes.Title) fmt.Printf("Copyright: %s\n", apodRes.Copyright) fmt.Printf("Date: %s\n\n", apodRes.Date) -- cgit 1.4.1-2-gfad0