use PrintErrln instead of log

This commit is contained in:
filifa
2025-09-18 00:09:28 -04:00
parent 9e6f648f0b
commit 2fd9b940d5
3 changed files with 5 additions and 7 deletions

View File

@@ -18,7 +18,6 @@ package cmd
import (
"fmt"
"log"
"math/big"
"github.com/spf13/cobra"
@@ -31,13 +30,13 @@ func sqrtRepetend(cmd *cobra.Command, args []string) {
for _, s := range args {
_, ok := x.SetString(s, 10)
if !ok {
log.Print("invalid input " + s)
cmd.PrintErrln("invalid input " + s)
continue
}
repetend, err := lib.SqrtRepetend(x)
if err != nil {
log.Print(s + " is a perfect square")
cmd.PrintErrln(s + " is a perfect square")
continue
}