summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-09-22 15:00:14 +0200
committerDimitri Sokolyuk <demon@dim13.org>2018-09-22 15:00:14 +0200
commit44b00088f7d87053fd2bb3b4ecfcaea79fd0c41d (patch)
tree07cf0de35520ad035e91a82553488ae2718461a8
parentdf35378bf5e86d3eb56c48cd6768a761ce3caf7c (diff)
solve accumulate
-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
+}