copier_time.go 226 B

123456789101112131415
  1. package copystructure
  2. import (
  3. "reflect"
  4. "time"
  5. )
  6. func init() {
  7. Copiers[reflect.TypeOf(time.Time{})] = timeCopier
  8. }
  9. func timeCopier(v interface{}) (interface{}, error) {
  10. // Just... copy it.
  11. return v.(time.Time), nil
  12. }