We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4cddc14 commit f0fd2e8Copy full SHA for f0fd2e8
1 file changed
columnize.go
@@ -95,7 +95,7 @@ func Format(input interface{}, config *Config) (string, error) {
95
}
96
97
// Remove trailing newline without removing leading/trailing space
98
- if n := len(result); result[n-1] == '\n' {
+ if n := len(result); n > 0 && result[n-1] == '\n' {
99
result = result[:n-1]
100
101
0 commit comments