yar999
Go语言圣经

Updated 2 years ago

Hun Dean (@hundan2020) started discussion #45

8 months ago · 0 comments

Open

Go语言中这种情况的解决方法是用空标识符(blank identifier),即_(也就是下划线)。空标识符可用于任何语法需要变量名但程序逻辑不需要的时候, 例如, 在循环里,丢弃不需要的循环索引, 保留元素值。大多数的Go程序员都会像上面这样使用range和_写echo程序,因为隐式地而非显示地索引os.Args,容易写对。

命令行参数 (Edit this file)

显示->显式

No description provided.

No comments on this discussion.


to join this conversation on GitBook. Already have an account? Sign in to comment
Notifications

You’re not receiving notifications from this thread.


1 participant