函数
fn sum(x, y int) int {
return x + y
}
println(sum(77, 33)) // 110fn full_name(first_name, last_name string) string {
return first_name + ' ' + last_name
}
println(full_name("Vitor", "Oliveira")) // Vitor Oliveira函数变量
fn foo(test ...string) {
for txt in test {
println(txt)
}
}
foo("V", "is", "the", "best", "lang" , "ever")多返回函数
高阶函数
命名规则
有效名称
无效名称
Exercises
Last updated
Was this helpful?