我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

省略号的所有用途

I am learning Go and it seems the ellipsis ... has at least 3 uses:

// #1: Array declarations
a := [...]int{1, 2, 3}

// #2: Variadic parameters
b := func (ints ...int) []int { return ints }(1, 2, 3)

// #3: Slice spread
c := append([]int{}, []int{1, 2, 3}...)

Does the ellipsis have other uses than the above 3?

As noted in the comments, these are all 3 use cases in the language, although the go tool uses ... as a path wildcard.

近期文章

  • 如何正确清理带有大量发送的Go通道
  • HDFS排除AddblockRequestProto中的数据节点
  • 在Heroku中使用本地软件包的Revel应用
  • sensulib包接口作为函数参数
  • 无法访问在另一个函数中更改的结构字段
  • 进入IRIS http框架,我无法正确路由
  • 杜松子酒拦截请求正文
  • 如何在Go中合并任意数据结构?
  • 使用sqlx重新获取Postgres中新插入的行
  • 监视文件的添加并获取最后添加的行
  • GoLang实时连接功能
  • 对子目录使用滑行
  • 将非ascii表单值另存为问号
  • python如何计算数组中每行数据的前五行平均值?
  • SQL结构和日历?
  • 是否存在任何BoltDB Ruby宝石绑定?
  • 按带重音的开始字符串搜索
  • Go和Dart之间的双向绑定
  • 以编程方式使用Google+帐户登录
  • 如何在Golang中为任何模型实施基本的CRUD操作?

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华