3 ms·
I think there are some obvious mistakes in it: 1) The NewXXX() function should return a pointer by Go idioms. But they return the value in this article. 2) For
by huanzhou_2006 14y ago
I think there are some obvious mistakes in it: 1) The NewXXX() function should return a pointer by Go idioms. But they return the value in this article. 2) For methods on IntSet type, it says the receiver should be pointer instead of value. "If we used values, these would be copied and any changes applied lost." Actually, since the data field is a reference, using value as receiver can change the content of the map.
Maybe not a good tutorial for people new to Go.
- objclxt 14y agoIn my opinion, the best tutorial for those new to Go is the official Go tour: http://tour.golang.org/ http://tour.golang.org/