Skip to content

Commit

Permalink
Merge pull request #206 from xoebus/patch-1
Browse files Browse the repository at this point in the history
make sure we can interface before we interface
  • Loading branch information
onsi committed Mar 26, 2017
2 parents 4ac488a + 7f8252c commit 334b8f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion format/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func formatValue(value reflect.Value, indentation uint) string {
case reflect.Map:
return formatMap(value, indentation)
case reflect.Struct:
if value.Type() == timeType {
if value.Type() == timeType && value.CanInterface() {
t, _ := value.Interface().(time.Time)
return t.Format(time.RFC3339Nano)
}
Expand Down

0 comments on commit 334b8f4

Please sign in to comment.