diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-02-26 19:54:48 +0100 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-06-18 16:30:36 +0200 |
commit | c8e1328164e9ffbd681c3c0e449f1e6b9856b896 (patch) | |
tree | faee639a4c55c5dc3bfc59a5400026822c40221d /pkg/list | |
download | lens-c8e1328164e9ffbd681c3c0e449f1e6b9856b896.tar.gz lens-c8e1328164e9ffbd681c3c0e449f1e6b9856b896.tar.bz2 lens-c8e1328164e9ffbd681c3c0e449f1e6b9856b896.zip |
feat: Inicial commit
It contains rough template for the server and runners.
It contains rough template for the server and runners.
Diffstat (limited to 'pkg/list')
-rw-r--r-- | pkg/list/list.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/list/list.go b/pkg/list/list.go new file mode 100644 index 0000000..ff259f7 --- /dev/null +++ b/pkg/list/list.go @@ -0,0 +1,9 @@ +package list + +func Map[V any, T any](source []V, fun func(V) T) []T { + result := make([]T, 0, len(source)) + for _, s := range source { + result = append(result, fun(s)) + } + return result +} |