fix: implement forbidigo's suggestion fmt.Println
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-05-27 22:28:43 +02:00
parent 6a2470db54
commit c79f4e811b
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
3 changed files with 7 additions and 6 deletions

View File

@ -5,6 +5,7 @@
import (
"fmt"
"log"
"os"
"github.com/spf13/cobra"
@ -42,7 +43,7 @@ func Execute() {
func help(*cobra.Command, []string) {
err := Root.Usage()
if err != nil {
fmt.Println(err)
log.Println(err)
os.Exit(1)
}
os.Exit(0)

View File

@ -4,7 +4,7 @@
package cmd
import (
"fmt"
"log"
"os"
"github.com/spf13/cobra"
@ -21,7 +21,7 @@
Short: "Print version information and exit",
Long: `All software has versions. This is ` + appName + `'s`,
RunE: func(cmd *cobra.Command, args []string) error {
fmt.Println(getVersion())
log.Println(getVersion())
return nil
},
PersistentPostRun: func(cmd *cobra.Command, args []string) {

View File

@ -4,7 +4,7 @@
package main
import (
"fmt"
"log"
"git.dotya.ml/wanderer/go-xkcdreader/cmd"
"git.dotya.ml/wanderer/go-xkcdreader/xkcdreader"
@ -15,9 +15,9 @@
func main() {
cmd.Execute()
fmt.Println("Starting " + cmd.GetAppName() + " " + version)
log.Println("Starting " + cmd.GetAppName() + " " + version)
xkcdreader.RunApp()
fmt.Println("Exited")
log.Println("Exited")
}