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

Go does have immutable data structures... They are called strings :-) It's not like Lisp or Scala, of course. Simply convert your slice to a string and you are set.

The slice behavior can be a bit surprising to new Go devs if they just jump in trying to write code. It's pretty common because Go looks simple and very familiar.

You can find more traps for new Go devs in this post: http://devs.cloudimmunity.com/gotchas-and-common-mistakes-in...



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

Search: