November 2017
Intermediate to advanced
670 pages
17h 35m
English
Here's an example of mapping a collection using the alediaferia/go-collections package:
names := []interface{}{ "Alice", "Bob", "Cindy", } collection := collections.NewFromSlice(names) collection = collection.Map(func(v interface{}) interface{} { return strings.Join([]string{"Hey", v.(string)}, " ") }) println(collection) // or the use of fmt.Println(collection)
The output is as follows:
Hey AliceHey BobHey Cindy