Go语言知识点
1. 大小写控制访问权限
2. { 不能放在单独的一行
# command-line-arguments
./hello.go:3:6: missing function body
./hello.go:4:1: syntax error: unexpected semicolon or newline before {3. 行分隔符
4. 空白标志符
package main
import "fmt"
func main() {
_,numb,strs := numbers() //只获取函数返回值的后两个
fmt.Println(numb,strs)
}
//一个可以返回多个值的函数
func numbers()(int,int,string){
a , b , c := 1 , 2 , "str"
return a,b,c
}Last updated