"Author complains he has to write 30 extra lines of code in Go.
"Person in comments provides a solution that reduces code to 10 lines.
"Author complains he has to write 10 extra lines of code in Go."
You are a developer, and you must write some code. Go is not a language meant to be all things to all people. Look at C++, C#, and Java to see what happens to languages that walk that road: they become bloated with features, fast.
In Javascript you don't need 10 lines of code to accomplish the same results and is still a small core language.
You would use some lib to do that, maybe the problem with go is the immature ecosystem.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
/u/shovelpost commented this on reddit.
"TL;DR
You are a developer, and you must write some code. Go is not a language meant to be all things to all people. Look at C++, C#, and Java to see what happens to languages that walk that road: they become bloated with features, fast.
In Javascript you don't need 10 lines of code to accomplish the same results and is still a small core language.
You would use some lib to do that, maybe the problem with go is the immature ecosystem.