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

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.

主站蜘蛛池模板: 万全县| 二手房| 视频| 桐梓县| 鱼台县| 蒲城县| 西城区| 辉南县| 合肥市| 大余县| 津市市| 黄冈市| 竹山县| 江陵县| 荣成市| 韩城市| 岳池县| 含山县| 天水市| 扶绥县| 仙桃市| 铜山县| 古浪县| 河源市| 新建县| 博客| 沁源县| 巧家县| 大丰市| 沙雅县| 平远县| 辽宁省| 太康县| 泰顺县| 苍溪县| 二连浩特市| 呼和浩特市| 中宁县| 稷山县| 廉江市| 乌兰县|