* Ian Lance Taylor <i...@golang.org> [181130 01:01]:
> On Thu, Nov 29, 2018 at 9:47 PM <zhangzhenta...@gmail.com> wrote:
> > The feature of golang is goroutine, and it is a normal situation that get 
> > time in different goroutine.
> > But only can set time.Location in one goroutine. So the Data Race is 
> > inevitable.
> >
> > And there is the replay from agnivade 3
> >
> > “It is not a bug. Please synchronize access to time.Location using 
> > synchronization primitives in the sync andsync/atomic packages.”
> >
> > But there are lots of place that time.Location used by time package of 
> > golang. For example: time.Now(), time.locabs()
> > I can’t change them.
> >
> > So, What should I do ? Please help me.
> 
> You said time.Location.  Do you mean time.Local?  It's true that you
> should never change time.Local.  Why  do you want to?  If you want to
> change the location of a specific time.Time value, call the In method.

For the OP's clarification, I believe he is trying to take the result of
t.Location(), which is a *time.Location, and happens to be the time.loc
private member of the Time struct (unless that is nil, in which case the
result is time.UTC), and assign to it.

However, your answer still stands.

...Marvin

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to