Re: [go-nuts] maps.Keys() does not work when keys are of type language.Tag

2022-10-06 Thread Ian Lance Taylor
On Thu, Oct 6, 2022 at 4:30 AM Jochen Voss wrote: > > Using "golang.org/x/text/language" I have a map of type map[language.Tag]int. > I would like to get the keys present in my map. Why does the following > command not work? > > import "golang.org/x/exp/maps" > ... > var x map[lang

[go-nuts] [security] golang.org/x/text/language fix pre-announcement

2022-10-06 Thread Roland Shoemaker
Hello gophers, We plan to issue a security fix for the golang.org/x/text/language package in the golang.org/x/text module on Tuesday, October 11th. Following our security policy, this is the pre-announcement of that fix. Cheers, Roland on behalf of the Go team -- You received this message beca

[go-nuts] Re: maps.Keys() does not work when keys are of type language.Tag

2022-10-06 Thread jake...@gmail.com
It appears to be because, deep down, the language.Tag struct contains an interface. While interfaces are "comparable", in that you can use == & !=, apparently they do not implement the 'comparable ' constraint. I'm not sure why this decision was made, th

[go-nuts] maps.Keys() does not work when keys are of type language.Tag

2022-10-06 Thread Jochen Voss
Hello, Using "golang.org/x/text/language" I have a map of type map[language.Tag]int. I would like to get the keys present in my map. Why does the following command not work? import "golang.org/x/exp/maps" ... var x map[language.Tag]int ... fmt.Println(maps.Keys(x)) The er