Skip to content

Commit

Permalink
table: fix panic during type conversion (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
jedib0t authored Aug 19, 2018
1 parent 81dd4da commit 2d30ee9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions table/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package table
import (
"fmt"
"io"
"reflect"
"strings"
"unicode/utf8"

Expand Down Expand Up @@ -253,8 +252,8 @@ func (t *Table) analyzeAndStringify(row Row, isHeader bool, isFooter bool) rowSt

// convert to a string and store it in the row
var colStr string
if reflect.TypeOf(col).Kind() == reflect.String {
colStr = col.(string)
if colStrVal, ok := col.(string); ok {
colStr = colStrVal
} else {
colStr = fmt.Sprint(col)
}
Expand Down

0 comments on commit 2d30ee9

Please sign in to comment.