import "__"
s := []string{"a", "b", "c", "d"}
fn := func(s string) string {
return s + "!"
}
// Generic, interface based helpers
m:= __.Map(s, fn)
fmt.Println(m) //["a!", "b!", "c!", "d!"]
// Define your own typed functions
var SMap func([]string, func(string) string) []string
__.MakeMap(&SMap)
m := __.SMap(s, fn)
fmt.Println(m) //["a!", "b!", "c!", "d!"]
Totally not really designed for performance.
Ease of use, fast enough.
* Mostly, sort-of
© 2014 Toby Hede (@tobyhede). All rights reserved. | Design by TEMPLATED.