我已经开始在 golang 中工作,我正在尝试将 JSON 字符串解析为结构体,但它不起作用。
JSON 字符串:
dailies":[{"userAccessToken":"accessToken","uploadStartTimeInSeconds":1499744832,"uploadEndTimeInSeconds":1499744832,"callbackURL":"callbackurl"}]}
type pingDataFormat struct {
userAccessToken string
uploadStartTimeInSeconds int
uploadEndTimeInSeconds int
callbackURL string
}
Run Code Online (Sandbox Code Playgroud)
下面是将 JSON 字符串转换为结构的代码
pingJSON := make(map[string][]pingDataFormat)
err := json.Unmarshal([]byte(pingData), &pingJSON)
if err != nil {
panic(err)
}
fmt.Printf("\n\n json object:::: %v", pingJSON)
Run Code Online (Sandbox Code Playgroud)
输出是:
json object:::: map[dailies:[{ 0 0 }]]
这里的“日报”没有数据,那么我是否遵循正确的解析方法以及解析后如何获取数据?
我已使用 Health Kit 从我现有的应用程序与 Health App 建立连接,授予权限并执行读写操作。现在我想断开我的应用程序与健康应用程序的连接。那么是否可以使用 HealthKit 断开连接?
我试图通过源代码安装Ejabberd,但是当我运行make命令时,我发现了以下错误.
checking for yaml_parser_initialize in -lyaml... no
checking yaml.h usability... no
checking yaml.h presence... no
checking for yaml.h... no
configure: error: libyaml library was not found
ERROR: Command ['get-deps'] failed!
make: *** [deps/.got] Error 1
Run Code Online (Sandbox Code Playgroud)
我已经重新安装libyaml 0.2和其他版本使用make和brew,但仍然没有解决错误.如果你知道另一个解决方案而不是指导我