From 7f8252cfb54d978e1f08fde445f50dee5e71138d Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Sun, 26 Mar 2017 13:51:00 -0700 Subject: [PATCH] make sure we can interface before we interface --- format/format.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/format/format.go b/format/format.go index 0dac3bf4a..a9d265136 100644 --- a/format/format.go +++ b/format/format.go @@ -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) }