golang深入理解学习channel和goroutine 2019-03-19 约 689 字 预计阅读 2 分钟 golang 深入理解学习 channel 和 goroutine 通道分为无缓冲通道和有缓冲通道,无缓冲通道上的发送操作将会阻塞,直到另一个 goroutine 在对应的通道上执行接受操作,这时值传送完成, 阅读更多
golang水平扩展interface wrapper function 2019-03-12 约 1105 字 预计阅读 3 分钟 golang水平扩展interface wrapper function 什么是 Golang 的正交组合 - 水平组合思维:Tony Bai 的博客 - Coding in GO way - Orthogonal Composition 这篇文章研究其中提到的 interface wrapper fun 阅读更多
golang根据网卡获取第一个没有回路的本机ip地址 2019-03-11 约 491 字 预计阅读 1 分钟 golang根据网卡获取第一个没有回路的本机ip地址 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 // 获取主机index最小的IP func GetLocalIP() (ip 阅读更多
使用golang快速排序 2019-03-01 约 138 字 预计阅读 1 分钟 快速排序 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 func main() { // 测试代码 arr := []int{9, 8, 7, 6, 5, 1, 2, 3, 4, 0} fmt.Println(arr) quickSort(arr, 0, len(arr)) fmt.Println(arr) } func quickSortInt(arr []int, a, b int) { if b-a <= 1 阅读更多
js常用代码块 2018-09-12 约 533 字 预计阅读 2 分钟 js 常用代码块 js倒计时代码 @import “../../snippet/js/count_down.js” {cmd=javascript} cookie操作 @import “../../snippet/js/cookie.js” {cmd=javascript} html encode&decode @import “../../snippet/js/html_encode_decode.js” {cmd=javascript} ip网卡mac地址校验 @import “../../snippet/js/net_utils.js” {cmd=javascript} 获取前端markdown表格数据 @import “../../snippet/js/html_table2json.js” {cmd=javascript} 导出高德地 阅读更多