Passed
Push — main ( 8e8d23...7310eb )
by Clive
03:14
created

internal/utils/helper.go   A

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
dl 0
loc 7
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A utils.CenterString 0 3 1
1
package utils
2
3
import "strings"
4
5
func CenterString(str string, width int) string {
6
	spaces := int(float64(width-len(str)) / 2)
7
	return strings.Repeat(" ", spaces) + str + strings.Repeat(" ", width-(spaces+len(str)))
8
}
9