摘要: 一:error接口Go语言引入了一个关于错误处理的标准模式,即error接口,该接口的定义如下: type error interface { Error() string } 使用例子如下 func Add(a,b int) error{ if a>0 { err:=... 阅读全文
posted @ 2014-04-19 21:21 Dark_liu 阅读(1149) 评论(0) 推荐(0) 编辑
摘要: 1:下载sublime Text 3 地址http://www.sublimetext.com/32:接下来还要注意就是ST3下Package Control的安装,这个跟ST2上就不同了,因为更新了python的借口,用了python3,建议参考官方的方法:https://sublime.wbon... 阅读全文
posted @ 2014-04-19 02:10 Dark_liu 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 今天学习一下Go语言的函数,先来个例子 一:函数的声明func Add(a,b int,c int) (result int,err error){ //1:函数的参数定义和C类别的语言差不多,但是后面多了一个括号,代表的函数的返回值,代替了 C#中的ref和out if apublic 若是... 阅读全文
posted @ 2014-04-19 00:03 Dark_liu 阅读(350) 评论(0) 推荐(0) 编辑