mirror of
https://github.com/maride/pancap.git
synced 2024-11-22 16:54:25 +00:00
Add trailing newline to output if it's not present yet
This commit is contained in:
parent
22da3cc934
commit
0051217bb5
@ -3,6 +3,7 @@ package output
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -42,8 +43,13 @@ func PrintBlock(headline string, content string) {
|
|||||||
content = cutContent(content)
|
content = cutContent(content)
|
||||||
}
|
}
|
||||||
|
|
||||||
// And print our content.
|
// Print our content.
|
||||||
fmt.Print(content)
|
fmt.Print(content)
|
||||||
|
|
||||||
|
// Check if we need to add a newline character at the end
|
||||||
|
if !strings.HasSuffix(content, "\n") {
|
||||||
|
fmt.Print("\n")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cut content after MaxContentLines lines
|
// Cut content after MaxContentLines lines
|
||||||
|
Loading…
Reference in New Issue
Block a user