File: copier_time.go

package info (click to toggle)
golang-github-mitchellh-copystructure 0.0~git20161013.0.5af94ae-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 96 kB
  • sloc: makefile: 2
file content (15 lines) | stat: -rw-r--r-- 226 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package copystructure

import (
	"reflect"
	"time"
)

func init() {
	Copiers[reflect.TypeOf(time.Time{})] = timeCopier
}

func timeCopier(v interface{}) (interface{}, error) {
	// Just... copy it.
	return v.(time.Time), nil
}