[go-nuts] Is golang.org/x/text/message's Printer thread safe?

2024-04-22 Thread Xiangrong Fang
Is golang.org/x/text/message's *message.Printer safe to use in goroutines? Thanks. -- 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

Re: [go-nuts] Is golang.org/x/text/message's Printer thread safe?

2024-04-22 Thread Jan Mercl
On Mon, Apr 22, 2024 at 11:23 AM Xiangrong Fang wrote: > Is golang.org/x/text/message's *message.Printer safe to use in goroutines? I don't know, but usually things are safe for concurrent use by multiple goroutines only when explicitly documented as such. -- You received this message because

[go-nuts] Manual changes to /go/pkg/mod ?

2024-04-22 Thread Peter Bočan
Hello, I would like to ask you all, what will the Go compiler do, if somebody manually modifies the package stored in the /go/pkg/mod? Will the compiler redownload the unmodified change? Will the compiler recognise there has been a change in the mod folder? Regards, Peter. -- You received

Re: [go-nuts] error : undefined: app.NewWindow

2024-04-22 Thread 'Sebastien Binet' via golang-nuts
The latest tagged version of Gio removed that function. Please have a look at the release notes: https://gioui.org/news/2024-04 Hth, -s Apr 22, 2024 19:56:34 Ian Lance Taylor : > On Mon, Apr 22, 2024 at 10:54 AM AndyPeng wrote: >> >> Imported the "gioui.org/app" package,but got an error

[go-nuts] Critical Section - static analysis

2024-04-22 Thread Stephen Illingworth
Hello, I've created a proof-of-concept for a method of defining critical sections. Crucially, the scheme allows for static analysis, thereby helping prevent violations of the critical sections. It's a simple concept but I think it's something that can be built upon.

Re: [go-nuts] error : undefined: app.NewWindow

2024-04-22 Thread Ian Lance Taylor
On Mon, Apr 22, 2024 at 10:54 AM AndyPeng wrote: > > Imported the "gioui.org/app" package,but got an error when compiling: > undefined: app.NewWindow. Please tell us exactly what you did and exactly what happened. Show us the code. Ian -- You received this message because you are subscribed

[go-nuts] error : undefined: app.NewWindow

2024-04-22 Thread AndyPeng
Imported the "gioui.org/app" package,but got an error when compiling: undefined: app.NewWindow. -- 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

[go-nuts] generics question

2024-04-22 Thread Jochen Voss
Using generics, can I somehow write a constraint which says that *T (instead of T) implements a certain interface? The following code illustrated what I'm trying to do: type A int func (a *A) Set(x int) { *a = A(x) } type B string func (b *B) Set(x int) { *b = B(strconv.Itoa(x)) } type C1

Re: [go-nuts] generics question

2024-04-22 Thread Ian Lance Taylor
On Mon, Apr 22, 2024 at 2:25 PM Jochen Voss wrote: > > Using generics, can I somehow write a constraint which says that *T (instead > of T) implements a certain interface? The following code illustrated what > I'm trying to do: > > type A int > > func (a *A) Set(x int) { > *a = A(x) > } > >

Re: [go-nuts] Is golang.org/x/text/message's Printer thread safe?

2024-04-22 Thread Xiangrong Fang
Thanks for the tip! Jan Mercl <0xj...@gmail.com> 于2024年4月22日周一 17:38写道: > On Mon, Apr 22, 2024 at 11:23 AM Xiangrong Fang wrote: > > > Is golang.org/x/text/message's *message.Printer safe to use in > goroutines? > > I don't know, but usually things are safe for concurrent use by > multiple

Re: [go-nuts] generics question

2024-04-22 Thread Nagaev Boris
On Mon, Apr 22, 2024 at 9:54 PM Ian Lance Taylor wrote: > > On Mon, Apr 22, 2024 at 2:25 PM Jochen Voss wrote: > > > > Using generics, can I somehow write a constraint which says that *T > > (instead of T) implements a certain interface? The following code > > illustrated what I'm trying to