Drop support for Go 1.16 and Go 1.17 (#203) Fixes #184
1 file changed, 9 insertions(+), 0 deletions(-)
changed files
M gomponents.go → gomponents.go
@@ -246,6 +246,15 @@ return err }) } +// Map a slice of anything to a slice of Nodes. +func Map[T any](ts []T, cb func(T) Node) []Node { + var nodes []Node + for _, t := range ts { + nodes = append(nodes, cb(t)) + } + return nodes +} + type group struct { children []Node }