摘要: 用法 https://juejin.im/post/5ef6eed9f265da22a8513d57 直接参考上面的链接即可 一个有意思的地方 这段代码的意思是如果到了该执行下一次任务时上次任务还在执行则跳过下次任务,这种写法还是第一次看到 // SkipIfStillRunning skips a 阅读全文
posted @ 2020-06-30 21:31 zhangyu63 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 定义函数类型 声明函数类型的变量和为变量赋值 package main import "fmt" type Operation func(a, b int) int func Add(a, b int) int { return a + b } func main() { var op Operat 阅读全文
posted @ 2020-06-30 13:48 zhangyu63 阅读(184) 评论(0) 推荐(0) 编辑
摘要: golang实现,比较简单的版本 package lru import "container/list" type Node struct { K, V interface{} } type LRU struct { list *list.List cacheMap map[interface{}] 阅读全文
posted @ 2020-06-30 11:17 zhangyu63 阅读(121) 评论(0) 推荐(0) 编辑
摘要: // Body represents the response body.//// The response body is streamed on demand as the Body field// is read. If the network connection fails or the 阅读全文
posted @ 2020-06-30 09:56 zhangyu63 阅读(291) 评论(0) 推荐(0) 编辑