Go中的缩进:制表符或空格?

是否有一个标准的Google Go编码约定文件,用于设置在Go源代码中是否使用制表符或空格来缩进? 如果不是,那么(统计上)更受欢迎的select是什么?

  1. 什么是官方build议? (如果有的话)
  2. 什么是更受欢迎的select?

官方的build议是格式化你的代码

go fmt 

或直接使用gofmt命令

 gofmt -w . 

您可以在golang.org博客或Effective Go文档中阅读更多内容:

缩进
我们使用制表符缩进,gofmt默认发射它们。 只有你必须使用空格。

根据http://golang.org/src/cmd/gofmt/doc.go ,默认值是:

编辑:底部原来的答案现在是不正确的。 链接的源文件(当前25/07/2014)的正确部分是:

Gofmt格式Go程序。
它使用制表符(宽度= 8)缩进和空白alignment。

原始答案(已弃用):

 Formatting control flags: -comments=true Print comments; if false, all comments are elided from the output. -tabs=true Indent with tabs; if false, spaces are used instead. -tabwidth=8 Tab width in spaces.