github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/text/unicode/cldr/examples_test.go (about) 1 package cldr_test 2 3 import ( 4 "fmt" 5 6 "golang.org/x/text/unicode/cldr" 7 ) 8 9 func ExampleSlice() { 10 var dr *cldr.CLDR // assume this is initalized 11 12 x, _ := dr.LDML("en") 13 cs := x.Collations.Collation 14 // remove all but the default 15 cldr.MakeSlice(&cs).Filter(func(e cldr.Elem) bool { 16 return e.GetCommon().Type != x.Collations.Default() 17 }) 18 for i, c := range cs { 19 fmt.Println(i, c.Type) 20 } 21 }