翔云

Just try, don't shy. 最新文章请点击
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2018年11月4日

摘要: 要判断interface 空的问题,首先看下其底层实现。 interface 底层结构 根据 interface 是否包含有 method,底层实现上用两种 struct 来表示:iface 和 eface。eface表示不含 method 的 interface 结构,或者叫 empty inte 阅读全文

posted @ 2018-11-04 13:17 翔云123456 阅读(12338) 评论(0) 推荐(0) 编辑

摘要: golang提供内建函数cap用于查看channel缓冲区长度。 cap的定义如下: Example output: ch1 buffer len:0 ch2 buffer len:2 阅读全文

posted @ 2018-11-04 10:15 翔云123456 阅读(2344) 评论(0) 推荐(0) 编辑