- --制表位
- --换行符
- \--一个
- "--一个”
- --回车
行注释://,一次性注释多行指令,选中代码后ctrl+/
块注释:/* */
代码规范:
(1)官方推荐使用行注释;
(2)使用tab键进行缩进,或者使用gofmt进行格式化,即在命令行输入gofmt -w XXX.go;
(3)运算符两边习惯加一个空格:a = 1 + 2;
package main import "fmt" func main(){ fmt.Println("hello") }
(4)推荐一行不超过80个字符,可用逗号连接;