08 2018 档案

摘要:// 初始化 map m1 = make(map[string]string) // 初始化 数组 var array3 = []int{9, 10, 11, 12} var a [4]int a[0] = 1 阅读全文
posted @ 2018-08-06 15:41 webglcn 阅读(321) 评论(0) 推荐(0)
摘要:1. struct的方法 阅读全文
posted @ 2018-08-03 13:21 webglcn 阅读(157) 评论(0) 推荐(0)
摘要:https://www.cnblogs.com/diegodu/p/5590133.html // 反射,根据字段名设置值 阅读全文
posted @ 2018-08-02 18:55 webglcn 阅读(95) 评论(0) 推荐(0)
摘要:http://blog.haohtml.com/archives/14239 struct定义的属性如果是小写开头的,那么该属性不是public的,不能跨包调用 (implicit assignment of unexported field) 阅读全文
posted @ 2018-08-02 17:22 webglcn 阅读(138) 评论(0) 推荐(0)
摘要:任意类型 遍历并判断类型 阅读全文
posted @ 2018-08-02 15:10 webglcn 阅读(90) 评论(0) 推荐(0)
摘要:遍历 啊 阅读全文
posted @ 2018-08-02 14:10 webglcn 阅读(105) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/tennysonsky/article/details/78946265 error(不中断)、panic(中断)、recover(拦截中断 类似于 catch) errors.New("a normal err1") 不会中断执行 panic(" err 阅读全文
posted @ 2018-08-02 09:26 webglcn 阅读(199) 评论(0) 推荐(0)
摘要:https://www.cnblogs.com/chase-wind/p/5644838.html 空接口可以指向任何数据对象,所以可以使用interface{}定义任意类型变量,同时interface{}也是类型安全的。 变长int类型的参数 变长不定类型的参数, 判断参数类型 arg.(type 阅读全文
posted @ 2018-08-01 17:15 webglcn 阅读(242) 评论(0) 推荐(0)
摘要:https://www.cnblogs.com/bonelee/p/6861777.html 函数返回之前(或任意位置执行 return 语句之后)一刻才执行某个语句或函数。用法类似于面向对象编程语言 Java 和 C# 的 finally 语句块。 输出: In Function1 at the 阅读全文
posted @ 2018-08-01 15:38 webglcn 阅读(111) 评论(0) 推荐(0)