Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I got caught with maps initially, and had to question why everything else was just "var x string", which also gives it a value, but maps needed a "var x = make(make[string]string)", otherwise on first assignment it panics.

There's a good explanation somewhere, ah here it is: https://go.dev/blog/maps

But you get used to it, and move on, especially with the sort of TDD workflow that go test encourages



I know why it works the way it works, it doesn't make it a good design, which is the point of this discussion




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: