[go-nuts] Re: workspaces tutorial query

2022-03-12 Thread Sean Liao
Fixed on tip
ref: https://go.dev/issue/51449

On Saturday, March 12, 2022 at 9:40:04 AM UTC kortschak wrote:

> I was just taking a look at the workspaces tutorial and saw that while
> the doc says that adding the local example module will result in
>
> go 1.18
>
> use (
> ./hello
> ./example
> )
>
> what actually results is
>
> go 1.18
>
> use (
> ./hello
> example
> )
>
> The behaviour is otherwise as expected, but this may confuse some
> readers given that leading dots are important in other paths used by
> the build system.
>
> Should the doc be updated or is the tool's behaviour unexpected here?
>
> thanks
> Dan
>
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/b041ee79-c97f-428d-8263-9a273fa6f64dn%40googlegroups.com.


[go-nuts] Re: Golang interface union type parameter

2022-03-12 Thread Richiise Nugraha
OK seems i already got the answer
https://github.com/golang/go/issues/45346#issuecomment-862505803
https://github.com/golang/go/issues/49054

Pada Minggu, 13 Maret 2022 pukul 00.14.22 UTC+7 Richiise Nugraha menulis:

> https://go.dev/play/p/SgTiaeE9J2b?v=gotip
>
> Pada Sabtu, 12 Maret 2022 pukul 23.57.35 UTC+7 Richiise Nugraha menulis:
>
>> Is Go type parameter supports interface union? 
>>
>> My case
>> type MessageSpec interface { MessageA | MessageB }
>> type MessageA interface { ID() uint64 }
>> type MessageB interface { Uid() uint64 }
>>
>> but got compile error:
>> ./prog.go:14:2: cannot use main.MessageA in union (main.MessageA contains 
>> methods) ./prog.go:14:13: cannot use main.MessageB in union (main.MessageB 
>> contains methods)
>>
>> I tried to look for documentation and readed 
>> https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#interface-types-in-union-elements
>>
>> There's example 
>> > type Stringish interface { string | fmt.Stringer }
>>
>> but it also throwing error
>> > ./prog.go:19:11: cannot use fmt.Stringer in union (fmt.Stringer 
>> contains methods)
>>
>> Is this a bug? i know my case is not the same thing as like the one i 
>> referenced from the proposal
>> but it is throwing the same error. 
>> 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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/94045799-c215-4d8d-8d47-d13513a7be01n%40googlegroups.com.


[go-nuts] Re: Golang interface union type parameter

2022-03-12 Thread Richiise Nugraha
https://go.dev/play/p/SgTiaeE9J2b?v=gotip

Pada Sabtu, 12 Maret 2022 pukul 23.57.35 UTC+7 Richiise Nugraha menulis:

> Is Go type parameter supports interface union? 
>
> My case
> type MessageSpec interface { MessageA | MessageB }
> type MessageA interface { ID() uint64 }
> type MessageB interface { Uid() uint64 }
>
> but got compile error:
> ./prog.go:14:2: cannot use main.MessageA in union (main.MessageA contains 
> methods) ./prog.go:14:13: cannot use main.MessageB in union (main.MessageB 
> contains methods)
>
> I tried to look for documentation and readed 
> https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#interface-types-in-union-elements
>
> There's example 
> > type Stringish interface { string | fmt.Stringer }
>
> but it also throwing error
> > ./prog.go:19:11: cannot use fmt.Stringer in union (fmt.Stringer 
> contains methods)
>
> Is this a bug? i know my case is not the same thing as like the one i 
> referenced from the proposal
> but it is throwing the same error. 
> 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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/40713b9b-6a54-41c4-b57d-b813a70d4ecdn%40googlegroups.com.


[go-nuts] Golang interface union type parameter

2022-03-12 Thread Richiise Nugraha
Is Go type parameter supports interface union? 

My case
type MessageSpec interface { MessageA | MessageB }
type MessageA interface { ID() uint64 }
type MessageB interface { Uid() uint64 }

but got compile error:
./prog.go:14:2: cannot use main.MessageA in union (main.MessageA contains 
methods) ./prog.go:14:13: cannot use main.MessageB in union (main.MessageB 
contains methods)

I tried to look for documentation and readed 
https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#interface-types-in-union-elements

There's example 
> type Stringish interface { string | fmt.Stringer }

but it also throwing error
> ./prog.go:19:11: cannot use fmt.Stringer in union (fmt.Stringer contains 
methods)

Is this a bug? i know my case is not the same thing as like the one i 
referenced from the proposal
but it is throwing the same error. 
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...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/4b0e90b7-ef7e-4b6f-a319-1392f3fc884cn%40googlegroups.com.


[go-nuts] workspaces tutorial query

2022-03-12 Thread 'Dan Kortschak' via golang-nuts
I was just taking a look at the workspaces tutorial and saw that while
the doc says that adding the local example module will result in

   go 1.18

   use (
   ./hello
   ./example
   )

what actually results is

   go 1.18

   use (
./hello
example
   )

The behaviour is otherwise as expected, but this may confuse some
readers given that leading dots are important in other paths used by
the build system.

Should the doc be updated or is the tool's behaviour unexpected here?

thanks
Dan


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/d760e618722b1549d0fa83df71980c8c5db11e45.camel%40kortschak.io.