New upstream version 0.1.0
Anthony Fok
1 year, 7 months ago
229 | 229 | fmt.Fprintf(p.w, "%s}", in) |
230 | 230 | |
231 | 231 | case reflect.Struct: |
232 | if td, ok := v.Interface().(time.Time); ok { | |
232 | if td, ok := asTime(v); ok { | |
233 | 233 | timeToGo(p.w, td) |
234 | 234 | } else { |
235 | 235 | if showType { |
287 | 287 | fmt.Fprintf(p.w, "%v", v) |
288 | 288 | } |
289 | 289 | } |
290 | } | |
291 | ||
292 | func asTime(v reflect.Value) (time.Time, bool) { | |
293 | if !v.CanInterface() { | |
294 | return time.Time{}, false | |
295 | } | |
296 | t, ok := v.Interface().(time.Time) | |
297 | return t, ok | |
290 | 298 | } |
291 | 299 | |
292 | 300 | // String returns a string representing v. |