Hacker News new | past | comments | ask | show | jobs | submit login

Because the predominant patterns are to do concurrency with message passing, so having multiple goroutines trying to mutate the same container is the exceptional case (though as you say, mutexes are the answer when needed). Another reason is containers are embedded features not stdlib, which has huge implications to how willing someone is to go against the grain, for better and worse.



Ironically, golang does not have constructs to build immutable types to pass them around, while Java does (records).


Yet another reason is that you really want generics for container types and Go's generics are relatively new




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: