« first day (174 days earlier)      last day (759 days later) » 

7:30 AM
you need collection []interface{} for this.
 
7:41 AM
and casts. so much for static typing.
 
 
14 hours later…
9:39 PM
@skripted you can use an interface, for example: play.golang.org/p/10lcjFK-4J
 
user986408
@OneOfOne oh, looks great
 
user986408
thanks
 
You're welcome :)
 
9:57 PM
@skripted generics are nice and all to have but hardly a deal breaker, and the mentioned reddit post is rather pointless, go gives you the power to shoot yourself in the foot, somewhere between C and C++ without all the uglyness.
If you're using interface{} to pass pointers around that much (or if you can't write a proper interface for your code) then you can always have something like func IsNil(i interface{}) bool { v := reflect.ValueOf(i); return v.Kind() == reflect.Ptr && v.IsNil() }, but again any proper coding wouldn't need to do that.
 

« first day (174 days earlier)      last day (759 days later) »