github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/libraries/golang/text/unicode/cldr/examples_test.go (about)

     1  package cldr_test
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/insionng/yougam/libraries/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  }