diff --git a/formatter/errors.go b/formatter/errors.go index c973ce9..2f49db0 100644 --- a/formatter/errors.go +++ b/formatter/errors.go @@ -28,8 +28,8 @@ func (e ridlErrors) getLenghts() (codeLen, nameLen, descLen, httpLen int) { nameLen = len(err.name) } - if len(err.description) > descLen { - descLen = len(err.description) + if len([]rune(err.description)) > descLen { + descLen = len([]rune(err.description)) } if len(fmt.Sprintf("%d", err.httpCode)) > httpLen { diff --git a/formatter/processor.go b/formatter/processor.go index c1b5181..f1651e0 100644 --- a/formatter/processor.go +++ b/formatter/processor.go @@ -292,7 +292,7 @@ func (f *form) errorsPrint() string { nameLen, err.name, err.description, - strings.Repeat(" ", descLen-len(err.description)), + strings.Repeat(" ", descLen-len([]rune(err.description))), httpLen, err.httpCode, )