标签:ons 列表 返回值 自增 使用 多行注释 number 不能 函数
? func 函数名 (参数列表)(返回值列表){}
func add{
pass
}
func add(a int, b int){
}
func add(a int, b int)(int, int){
}
1. // 单行注释
2. /* */ 多行注释
1. 常量使用const修饰,代表永远是只读的,不能修改的
2. const 只能修饰boolean、number(int/float/complex)、string
3. 语法:const identifer[type] = value ,其中type可省略
const(
a = 0
b = 1
c = 2
)
或
const(
// a默认赋值0,后面自增1
a = iota
b
c
)
标签:ons 列表 返回值 自增 使用 多行注释 number 不能 函数
原文地址:https://www.cnblogs.com/hq82/p/11069939.html