官术网_书友最值得收藏!

Leave your baggage at the door

If you were to ask me what is the most frequent mistake new Go programmers make?, I would not hesitate to tell you that it's bringing other language patterns into Go. I know this was my biggest early mistake. My first Go service looked like a Java app written in Go. Not only was the result subpar but it was rather painful, particularly while I was trying to achieve things such as inheritance. I've had a similar experience programming Go in a functional style, as you might see in Node.js.

In short, please don't do it. Re-read Effective Go and Go blogs as often as you need to until you find yourself using small interfaces, firing off Go routines without reservation, loving channels, and wondering why you ever needed more than composition to achieve nice polymorphism.

主站蜘蛛池模板: 丹东市| 乐东| 丹寨县| 鄢陵县| 永清县| 思茅市| 瑞昌市| 巧家县| 山东省| 怀集县| 阿巴嘎旗| 独山县| 库尔勒市| 珠海市| 宣武区| 天台县| 仁怀市| 新疆| 包头市| 威远县| 札达县| 苗栗市| 耒阳市| 石阡县| 双鸭山市| 贵溪市| 额济纳旗| 九龙县| 黎平县| 弥渡县| 革吉县| 绥滨县| 当雄县| 双桥区| 合江县| 江西省| 彭水| 安庆市| 延长县| 孟连| 汉中市|