add value vithh error (#1)
Co-authored-by: andrey1s <andrey@4devs.pro> Reviewed-on: #1 Co-authored-by: andrey <andrey@4devs.io> Co-committed-by: andrey <andrey@4devs.io>
This commit was merged in pull request #1.
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -8,6 +8,8 @@ import (
|
||||
)
|
||||
|
||||
func TestFormatter(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
ctx := context.Background()
|
||||
formatter := formatter.New()
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ import (
|
||||
)
|
||||
|
||||
func TestNone(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
ctx := context.Background()
|
||||
none := formatter.None()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user