Commit cde6014f authored by Artemis's avatar Artemis 🐱

Fix: handled case when there's only one line

parent eac74e2c
......@@ -24,10 +24,13 @@ func Lineno(input string) string {
count := lineCount(input)
output := ""
for i := uint(1); i < count; i++ {
for i := uint(1); i <= count; i++ {
output += fmt.Sprintf("%d\n", i)
}
if len(output) == 0 {
return output
}
return output[:len(output) - 1]
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment