You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The linter forbidigo can catch such cases. I'd recommend to enable it.
provider/nowsms/nowsms.go:67:2: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)
fmt.Println("Message sent: ", message.Text)
^
provider/tencentcloud/tencentcloud.go:79:4: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)
fmt.Printf("An API error has returned: %s", err)
^
provider/tencentcloud/tencentcloud.go:87:3: use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)
fmt.Printf("%s", b)
^
provider/kavenegar/kavenegar.go:64:2: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)
fmt.Println("Message sent: ", message.Text)
^
provider/ghasedak/ghasedak.go:63:2: use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)
fmt.Println("Message sent: ", message.Text)
The text was updated successfully, but these errors were encountered:
fmt.Print
,fmt.Printf
,fmt.Println
and etc. can clog output. For example: a report ofgo test
. Also, we can't test it.If we use it for logging then lets just use logger instead.
If we really want to throw some message to the stdout then we can use
io.Writer
or just return the message
and handle somewhere in the main func.
The linter forbidigo can catch such cases. I'd recommend to enable it.
The text was updated successfully, but these errors were encountered: