aceberg/LinuxExecBot

View on GitHub
internal/check/error.go

Summary

Maintainability
A
0 mins
Test Coverage
package check

import (
    "fmt"
    "log"
)

// IfError prints error, if it is not nil
func IfError(err error) bool {
    if err == nil {
        return false
    }

    log.Printf("\x1b[31;1m%s\x1b[0m\n", fmt.Sprintf("ERROR: %s", err))
    return true
}