译文:https://github.com/wuYin/blog/blob/master/50-shades-of-golang-traps-gotchas-mistakes.md 原文:50 Shades of Go: Traps, Gotchas, and Common Mistakes,翻译已获作者 kcqon 授权. 不久前发现在知乎这篇质量很高的文章,打算加上自己的理解翻译一遍.文章分为三部分:初级篇 1-34,中级篇 35-50,高级篇 51-57 前言 Go 是一门简单有趣的编程语
一.Go语言基础 1. 基础 Go语言中的标识符必须以字母(Unicode字母,PHP/JS可以用中文作为变量名)下划线开头.大写字母跟小写字母是不同的:Hello和hello是两个不同的名字. Go中有25个关键字: break default func interface select case defer go map struct chan else goto package switch const fallthrough if range type continue for imp