摘要:
要判断interface 空的问题,首先看下其底层实现。 interface 底层结构 根据 interface 是否包含有 method,底层实现上用两种 struct 来表示:iface 和 eface。eface表示不含 method 的 interface 结构,或者叫 empty inte 阅读全文
posted @ 2018-11-04 13:17 翔云123456 阅读(12412) 评论(0) 推荐(0)
|
摘要:
要判断interface 空的问题,首先看下其底层实现。 interface 底层结构 根据 interface 是否包含有 method,底层实现上用两种 struct 来表示:iface 和 eface。eface表示不含 method 的 interface 结构,或者叫 empty inte 阅读全文
posted @ 2018-11-04 13:17 翔云123456 阅读(12412) 评论(0) 推荐(0)
摘要:
golang提供内建函数cap用于查看channel缓冲区长度。 cap的定义如下: Example output: ch1 buffer len:0 ch2 buffer len:2 阅读全文
posted @ 2018-11-04 10:15 翔云123456 阅读(2366) 评论(0) 推荐(0) |
||