On Friday, February 11, 2022 at 10:02:42 AM UTC-5 kziem...@gmail.com wrote:

> I'm seriously lost here. Code below works in both Go 1.17 and Go 1.18beta2
>
> > package main
> >
> > import "fmt"
> >
> > type someInterface[3] interface {
> >         SomeMethod()
> > }
> >
> > func main() {
> >         var varSI someInterface
> >
> >         fmt.Printf("varSI value: %v\n", varSI)
> >         fmt.Printf("varSI type:  %T\n", varSI)
> > }
>
> and give in both cases result
> > varSI value: [<nil> <nil> <nil>]
> > varSI type:  main.someInterface
>
> I didn't find any way to assign some new value to "varSI", but this is 
> already disturbing to me.
>

FWIW, here is code that assigns to varSI in two ways:  
https://go.dev/play/p/ypj6rQbpBBl
Note that running this code in the playground will reformat ' type 
someInterface[3] interface' to the proper ' type someInterface 
[3]interface'. This is not a change in meaning, just a clarifying white 
space change made by `go fmt`. 

-- 
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/0e5d1a3f-c4fa-4cc3-b503-bfb885487dben%40googlegroups.com.

Reply via email to