We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
原文地址
import _ "net/http/pprof"
引入包,会先调用包中的初始化函数,这种使用方式仅让导入的包做初始化,而不使用包中其他功能
_,err := func()
忽略某个返回值
type T struct{} var _ M = T{}
用来判断 type T是否实现了 M,用作类型断言,如果 T 没有实现接口 I,则编译错误
func demo() ( sumA int, sumB int, _ string, total int ,_ error)
返回参数 int 加了名字,对比上面,便于理解,但是 string 和 error 没有名字,编译会报错,用下划线可以忽略命名
The text was updated successfully, but these errors were encountered:
git-zjx
No branches or pull requests
原文地址
引入包,会先调用包中的初始化函数,这种使用方式仅让导入的包做初始化,而不使用包中其他功能
忽略某个返回值
用来判断 type T是否实现了 M,用作类型断言,如果 T 没有实现接口 I,则编译错误
返回参数 int 加了名字,对比上面,便于理解,但是 string 和 error 没有名字,编译会报错,用下划线可以忽略命名
The text was updated successfully, but these errors were encountered: