标签:golang

教程

Golang 连接 Redis 用法

首先安装 Redis的类库,可以选择 redigo 或者go-redis 我们以 go-redis 为例 安装包,命令行执行: go get -u github.com/go-redis/redis package main import ( "github.com/...

shanhuhai 7年前 (2017-09-24) 9717℃ 5喜欢

Golang

Golang json解析的用法

Golang 的 json 解析不同于 PHP, PHP 是弱类型的语言,json 解析的结果可以直接放到 PHP 的数组中, Golang 需要根据json的数据结构预先定义好数据类型,这样才能存储 json 解析后的结果。 在Golang 中使用结构体(struct)和切片(...

shanhuhai 7年前 (2017-09-21) 14517℃ 5喜欢