摘要: 关于golang.org/x包问题 由于谷歌被墙,跟谷歌相关的模块无法通过go get来下载,解决方法: git clone https://github.com/golang/net.git $GOPATH/src/github.com/golang/net git clone https://g 阅读全文
posted @ 2019-03-30 23:00 opensmarty 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 在国内采用go get有时会下载不到一些网站如golang.org的依赖包。 方法1(亲测有效): gopm 代替go 下载第三方依赖包可以采用gopm从golang.org一些镜像网站上下载。 注意,gopm只能把包的原代码下载,需要自己去go install。 a). 安装gopm b). 用g 阅读全文
posted @ 2019-03-30 22:59 opensmarty 阅读(693) 评论(0) 推荐(0) 编辑
摘要: 使用 ... 运算符定义变长参数函数 (PHP 5 >= 5.6.0, PHP 7) 现在可以不依赖 func_get_args(), 使用 ... 运算符 来实现 变长参数函数。 以上例程会输出: $req: 1; $opt: 0; number of params: 0 $req: 1; $op 阅读全文
posted @ 2019-03-30 22:36 opensmarty 阅读(4195) 评论(0) 推荐(1) 编辑
摘要: php5.6.x到php7.0.x特性 1.标量类型声明 字符串(string), 整数 (int), 浮点数 (float), 布尔值 (bool),callable,array,self,Class/interface name 2.返回值类型声明 定义参数类型和返回值类型 function t 阅读全文
posted @ 2019-03-30 22:12 opensmarty 阅读(234) 评论(0) 推荐(0) 编辑
摘要: PHP5.4.0新特性研究 1、内建Web Server 这的确是个好的改进,大大的方便了开发人员。以后开发机不装nginx,httpd也行 如: 前台运行: 后台运行: 2、数组定义,增加了一种简便写法 结果: Array ( [0] => 1 [1] => 2 [2] => 3 ) Array 阅读全文
posted @ 2019-03-30 22:11 opensmarty 阅读(116) 评论(0) 推荐(0) 编辑