summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--go/accumulate/accumulate.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/go/accumulate/accumulate.go b/go/accumulate/accumulate.go
new file mode 100644
index 0000000..f12ff87
--- /dev/null
+++ b/go/accumulate/accumulate.go
@@ -0,0 +1,9 @@
+package accumulate
+
+func Accumulate(s []string, f func(string) string) []string {
+ ret := make([]string, len(s))
+ for i, v := range s {
+ ret[i] = f(v)
+ }
+ return ret
+}