func ConditionString(cond bool, valid, inValid string) string {
	if cond {
		return valid
	}
	return inValid
}
Simple Condition for string
Returns value based on condition
package tablewriter
import (
	"math"
	"regexp"
	"strings"
	"github.com/mattn/go-runewidth"
)
var ansi = regexp.MustCompile("\033\\[(?:[0-9]{1,3}(?:;[0-9]{1,3})*)?[m|K]")
func DisplayWidth(str string) int {
	return runewidth.StringWidth(ansi.ReplaceAllLiteralString(str, ""))
}