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

为什么不“关闭”保留关键字? [关闭]

close() seems to be a reserved keyword for channels. Seems a bit strong to make it a built-in, when it could just be a method on a channel, no? Like when creating and closing a file?

I guess the same could be asked for len()?

close is a function that takes a channel as a parameter. Just like new and make, they are functions, and you can name local variables or functions like them.

Keywords are language constructs like struct, type, if, else ...

近期文章

  • 无法从发布请求中解析JSON
  • 在golang的struct中嵌入的接口感到困惑
  • Golang mongo-go-driver Beta 1,使用大于运算符
  • 进行测试<功能>返回未定义:<功能>
  • 从go lang程序启动终端窗口?
  • 审核完成后,命名文件必须全部位于一个目录中。
  • Golang SIGSEGV仅在“第二次”通话中
  • 创建通用函数以从地图提取值
  • 等待一个goroutine完成[重复]
  • 设置未检测到Cookie
  • 即使我转到不存在的路由,net / http也会渲染根路由
  • Golang无法转义字符串变量
  • apache怎样在局域网自定义多域名,访问多站点?
  • Golang TCP服务器读取HTTP / 2帧
  • 使用指针参考进行测试功能
  • 去Dep不在docker-compose上运行
  • 在将unmarshal用作通用接口时如何验证JSON?
  • 如何在Golang中的结构中访问切片
  • golang中的math.Pow是否适合此公式?
  • 在非主程序包中运行主程序

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华