Thank you both!
This works, see my code below. Followup question: is there a way to refer
to the new type without having to list both the element type and the
pointer type separately? Below I have to write C[A, *A], which looks
slightly ugly. And in my real application something like Creator
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 do
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)
> }
>
> typ
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 gor
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 s
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.
https://github.com/JetSetIlly
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 whe
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
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 golang-nuts+unsub
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 t
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
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 golang-nuts+unsubscr...@google
12 matches
Mail list logo