Tekkaman

导航

 

Go Packages、Variables、functions

1、定义包名。

  

2、引入Package。

  

3、定义导出的变量。首字母必须大写。

  

4、函数。Notice that the type comes after the variable name.

  

5、参数缩写。

  

6、函数可以返回任意数量返回值。

  

7、有名返回值。

  

8、有名返回值。

  

9、使用var定义变量。

  

10、带初始化器的定义。

  

11、函数内快速定义变量。

  Inside a function, the := short assignment statement can be used in place of a vardeclaration with implicit type.

  Outside a function, every statement begins with a keyword (varfunc, and so on) and so the := construct is not available.

  

12、go的变量类型。

  

  

13、变量默认值。

  

14、The expression T(v) converts the value v to the type T.

  

  

 15、类型推断。

  

  

16、Constants cannot be declared using the := syntax.

  
  

 

posted on 2015-02-05 13:41  Tekkaman  阅读(182)  评论(0编辑  收藏  举报