Trying to use generics with time.Time.
The general goal was to accept time.Time or milliseconds as int64
This code return the error:
Cannot use 'at' (type T) as the type time.Time
type SomeTime struct {
At time.Time
}
func PointFactory[T time.Time](at T) *SomeTime {
return &SomeTime{
At: at,
}
}
Is it possible to pass time.Time as parameter to generic function?
Thanks