add value vithh error
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing

This commit is contained in:
andrey1s
2022-09-18 21:26:55 +03:00
parent 2657672288
commit 94f5fe85c6
72 changed files with 2585 additions and 938 deletions

View File

@@ -8,7 +8,6 @@ import (
"gitoa.ru/go-4devs/console/output/style"
)
//nolint: gochecknoglobals
var re = regexp.MustCompile(`<(([a-z][^<>]+)|/([a-z][^<>]+)?)>`)
func WithStyle(styles func(string) (style.Style, error)) func(*Formatter) {
@@ -18,15 +17,15 @@ func WithStyle(styles func(string) (style.Style, error)) func(*Formatter) {
}
func New(opts ...func(*Formatter)) *Formatter {
f := &Formatter{
formatter := &Formatter{
styles: style.Find,
}
for _, opt := range opts {
opt(f)
opt(formatter)
}
return f
return formatter
}
type Formatter struct {

View File

@@ -8,6 +8,8 @@ import (
)
func TestFormatter(t *testing.T) {
t.Parallel()
ctx := context.Background()
formatter := formatter.New()

View File

@@ -8,6 +8,8 @@ import (
)
func TestNone(t *testing.T) {
t.Parallel()
ctx := context.Background()
none := formatter.None()