下载此文档

50 个 Go 开发者常犯的错误.doc.doc


文档分类:IT计算机 | 页数:约73页 举报非法文档有奖
1/73
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/73 下载此文档
文档列表 文档介绍
[英] 50 个 Go 开发者常犯的错误 Go isa simple and fun language, but, like any other language, it has a few gotchas... Many of those gotchas are not entirely Go's fault. Some of these mistakes are natural traps if you ing from another language. Others are due to faulty assumptions and missing details. A lot of these gotchas may seem obvious if you took the time to learn the language reading the official spec, wiki, mailing list discussions, many great posts and presentations by Rob Pike, and the source code. Not everybody starts the same way though and that's OK. If you are new to Go the information here will save you hours debugging your code. Total Beginner: ? Opening Brace Can't Be Placed on a Separate Line ? Unused Variables ? Unused Imports ? Short Variable Declarations Can Be Used Only Inside Functions ? Redeclaring Variables Using Short Variable Declarations ? Accidental Variable Shadowing ? Can't Use "nil" to Initialize a Variable Without an Explicit Type ? Map Capacity ? Strings Can't Be "nil" ? Array Function Arguments ? Unexpected Values in Slice and Array "range" Clauses ? Slices and Arrays Are One-Dimensional ? Accessing Non-Existing Map Keys ? Strings Are Immutable ? Conversions Between So Using "nil" Slices and Maps trings and Byte Slices ? Strings and Index Operator ? Strings Are Not Always UTF8 Text ? String Length ? ma In Multi-Line Slice/Array/Map Literals ? and Do More Than Log ? Built-in Data Structure Operations Are Not Synchronized ? Iteration Values For Strings in "range" Clauses ? Iterating Through a Map Using a "for range" Clause ? Fallthrough Behavior in "switch" Statements ? Increments and Decrements ? Bitwise NOT Operator ? Operator Precedence Differences ? Unexported Structure Fields Are Not Encoded ? App Exits With Active Goroutines ? Sending to an Unbuffered Channel Returns As Soon As the Target Receiver Is Ready ? Sending to an Closed Channel Causes a Panic ? Using "nil" Channels ? Methods with Value Receivers Can't Change th

50 个 Go 开发者常犯的错误.doc 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数73
  • 收藏数0 收藏
  • 顶次数0
  • 上传人jactupq736
  • 文件大小0 KB
  • 时间2016-06-07