Re: [go-nuts] When set time.Location, will be detected Data Race

2020-07-23 Thread Michael Cohen
Thanks Ian, this does not work as I mentioned because there is no way to guarantee that my init function will run before any of my libraries creating a time object (which many do as they start various background tasks). Doing what you say is fragile because even if it appears to work, one day I

Re: [go-nuts] How to know if interface{} data is nil w/o reflecting?

2018-05-08 Thread Michael Cohen
ug just waiting to bite. Thanks Michael. On Wednesday, 9 May 2018, Ian Lance Taylor <i...@golang.org> wrote: > On Tue, May 8, 2018 at 7:19 AM, Michael Cohen <scude...@gmail.com> wrote: > > > > Well no - the error I get is that I am attempting to call String() > meth

Re: [go-nuts] How to know if interface{} data is nil w/o reflecting?

2018-05-08 Thread Michael Cohen
Well no - the error I get is that I am attempting to call String() method on a null receiver - so the caller just passed me a regular nil object. The issue is that I am trying to make a generic polymorphic function which should be able to handle whatever is thrown at it - so I guess reflect is