github.com/m4gshm/gollections@v0.0.13-0.20240331203319-a34a86e58a24/internal/examples/constructors_mutable.go (about) 1 package examples 2 3 import ( 4 "github.com/m4gshm/gollections/collection/mutable" 5 mmap "github.com/m4gshm/gollections/collection/mutable/map_" 6 "github.com/m4gshm/gollections/collection/mutable/ordered" 7 omap "github.com/m4gshm/gollections/collection/mutable/ordered/map_" 8 oset "github.com/m4gshm/gollections/collection/mutable/ordered/set" 9 "github.com/m4gshm/gollections/collection/mutable/set" 10 "github.com/m4gshm/gollections/collection/mutable/vector" 11 "github.com/m4gshm/gollections/k" 12 ) 13 14 func _() { 15 capacity := 10 16 17 var ( 18 _ *mutable.Vector[int] = vector.Of(1, 2, 3) 19 _ *mutable.Vector[int] = new(mutable.Vector[int]) 20 _ *mutable.Vector[int] = vector.NewCap[int](capacity) 21 ) 22 var ( 23 _ *mutable.Set[int] = set.Of(1, 2, 3) 24 _ *mutable.Set[int] = new(mutable.Set[int]) 25 _ *mutable.Set[int] = set.NewCap[int](capacity) 26 _ *mutable.Set[int] = set.Empty[int]() 27 ) 28 var ( 29 _ *ordered.Set[int] = oset.Of(1, 2, 3) 30 _ *ordered.Set[int] = new(ordered.Set[int]) 31 _ *ordered.Set[int] = oset.NewCap[int](capacity) 32 _ *ordered.Set[int] = oset.Empty[int]() 33 ) 34 var ( 35 _ *mutable.Map[int, string] = mmap.Of(k.V(1, "1"), k.V(2, "2"), k.V(3, "3")) 36 _ *mutable.Map[int, string] = new(mutable.Map[int, string]) 37 _ *mutable.Map[int, string] = mmap.New[int, string](capacity) 38 _ *mutable.Map[int, string] = mmap.Empty[int, string]() 39 ) 40 var ( 41 _ *ordered.Map[int, string] = omap.Of(k.V(1, "1"), k.V(2, "2"), k.V(3, "3")) 42 _ *ordered.Map[int, string] = new(ordered.Map[int, string]) 43 _ *ordered.Map[int, string] = omap.New[int, string](capacity) 44 _ *ordered.Map[int, string] = omap.Empty[int, string]() 45 ) 46 }