howardjohn / blog-comments

0 stars 0 forks source link

posts/go-map/ #1

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

Ergonomic Map in Go | howardjohn's blog

In many languages, on of the things I find myself doing is maping over a list to extract some field. For example, coverting a []Person to []Name. Most languages these days have ways to do this pretty easily: Kotlin: people.map { it.Name } JavaScript: people.map(p => p.Name) Rust: people.map(|p| p.Name) Scala: people.map(_.Name) With generics, Go finally can do this in a type safe manner: Map(people, func(t Person) string { return t.

http://localhost:1313/posts/go-map/

howardjohn commented 1 year ago

test comment

xhd2015 commented 10 months ago

Your blogs are amazing, funny and inspiring!