Codebase list golang-github-alecthomas-repr / 9faeb46
New upstream version 0.1.0 Anthony Fok 1 year, 7 months ago
1 changed file(s) with 9 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
229229 fmt.Fprintf(p.w, "%s}", in)
230230
231231 case reflect.Struct:
232 if td, ok := v.Interface().(time.Time); ok {
232 if td, ok := asTime(v); ok {
233233 timeToGo(p.w, td)
234234 } else {
235235 if showType {
287287 fmt.Fprintf(p.w, "%v", v)
288288 }
289289 }
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
290298 }
291299
292300 // String returns a string representing v.