OSDN Git Service

new repo
[bytom/vapor.git] / vendor / golang.org / x / text / unicode / cldr / examples_test.go
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 initialized
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 }