只有可导出的成员可以转换为JSON字段。 //结构体成员名首字母大写才可以转换JSONtype Movie struct { Title string //字符串 Year int `json:"date"` //原生字符串 对应到date的成员标签 键json控制包encoding/json行为,... ...
分类:
Web程序 时间:
2018-07-14 16:25:40
阅读次数:
134
今天意外发现,如果在Azure上的Centos6.8or6.9的虚拟机上如果执行了“sudoyumremove-ynet-tools”后,再执行重新部署的话,虚拟机就会出现“kernelpanic”的报错,导致虚拟机无法正常启动。+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
分类:
其他好文 时间:
2018-07-09 15:27:32
阅读次数:
221
1、firewalld的基本使用启动: systemctl start firewalld查看状态: systemctl status firewalld 停止: systemctl disable firewalld禁用: systemctl stop firewalld2.systemctl是C ...
分类:
其他好文 时间:
2018-07-03 20:12:20
阅读次数:
157
针对Golang1.9的sync.Mutex进行分析,与Golang1.10基本一样除了将panic改为了throw之外其他的都一样。源代码位置:sync\mutex.go。可以看到注释如下:Mutexcanbein2modesofoperations:normalandstarvation.InnormalmodewaitersarequeuedinFIFOorder,butawokenupwa
分类:
其他好文 时间:
2018-07-01 20:28:49
阅读次数:
182
1. 读nil的channel是永远阻塞的。关闭nil的channel会造成panic。 2. closed channel的行为: 向close的channel发消息会panic。因为go建议向channel发送数据的人负责close channel。 如果close的channel还有数据,仍然 ...
分类:
其他好文 时间:
2018-06-30 14:58:25
阅读次数:
156
defer func退出时执行 panic 错误处理 chan 通道 goroutine os.Create(filename) 创建文件 os.Open(filename) 打开文件 bufio.NewWrite(file-obj) 写缓存 writer.Flush() 将缓存写到磁盘 bufio ...
分类:
编程语言 时间:
2018-06-27 22:18:21
阅读次数:
152
问题 go thrift开发过程中,多个goroutine共用一个client时,报错: panic: runtime error: index out of range goroutine 24 [running]: happy apple/vendor/git.apache.org/thrift ...
分类:
其他好文 时间:
2018-06-17 11:33:42
阅读次数:
169
sync.Map源码分析背景众所周知,go普通的map是不支持并发的,换而言之,不是线程(goroutine)安全的。博主是从golang1.4开始使用的,那时候map的并发读是没有支持,但是并发写会出现脏数据。golang1.6之后,并发地读写会直接panic:fatalerror:concurrentmapreadandmapwritepackagemainfuncmain(){m:=make
分类:
其他好文 时间:
2018-06-08 20:39:33
阅读次数:
169
firewall-cmd 命令详解 以及 TCP wrappers 服务的访问控制列表 ...
分类:
移动开发 时间:
2018-05-29 01:47:58
阅读次数:
3297
本文转载自:https://blog.csdn.net/zhangchiytu/article/details/8303172 oops是英语口语"糟糕"的意思,当LINUX 内核发生严重错误时,比如内存段错误时,将会提示一大段信息。 就提示 Oops(也称 panic),因此得名,Oops提示信息 ...
分类:
其他好文 时间:
2018-05-12 17:33:03
阅读次数:
186