上一页 1 2 3 4 5 6 ··· 9 下一页
摘要: CXC 官网: https://www.cxcblock.com 区块浏览器: https://explorer.cxcblock.com GitHub: https://github.com/cxcblock/cxcs 安装: 启动和停止: 阅读全文
posted @ 2019-08-28 13:45 pad+ 阅读(416) 评论(0) 推荐(0) 编辑
摘要: 原因分析: 在高并发的情况下,Spring事物造成数据库死锁,后续操作超时抛出异常。 Mysql数据库采用InnoDB模式,默认参数:innodb_lock_wait_timeout设置锁等待的时间是50s,一旦数据库锁超过这个时间就会报错。 解决方案 1、通过下面语句查找到为提交事务的数据,kil 阅读全文
posted @ 2019-08-16 16:03 pad+ 阅读(1603) 评论(0) 推荐(0) 编辑
摘要: package main import ( "fmt" "math" ) //自定义结构体错误,实现error接口 type InvaildradiusError struct { radius float64 Minradius float64 Maxreaius float64 } //封装工厂方法 func NewInvaildradi... 阅读全文
posted @ 2019-07-30 17:51 pad+ 阅读(158) 评论(0) 推荐(0) 编辑
摘要: package main import ( "errors" "fmt" "math" ) func GetToyBallvolume2 (redius float64)(volume float64,err error) { if redius 50 { err = errors.New("取值范围需要在[5,50]") ... 阅读全文
posted @ 2019-07-30 11:00 pad+ 阅读(109) 评论(0) 推荐(0) 编辑
摘要: package main import ( "fmt" "math" ) //求小球的体积 //如果半径是负数,返回pannic //处理pannic,温和的返回结果 func GetToyBallvolume(redius float64)float64 { if redius<0 { //redius 为负数,直接返回恐慌 ... 阅读全文
posted @ 2019-07-29 17:32 pad+ 阅读(151) 评论(0) 推荐(0) 编辑
摘要: package main import ( "encoding/json" "fmt" "os" ) //解码于谦.json 为map func main041() { //打开要解码的文件 srcFile, _ := os.Open("E:/go-project/daemon/w3/于谦.json") defer srcFile.Clos... 阅读全文
posted @ 2019-07-28 22:15 pad+ 阅读(293) 评论(0) 推荐(0) 编辑
摘要: package main import ( "encoding/json" "fmt" "os" ) //将于谦的信息map写入到一个json文件 func main021() { dataMap := make(map[string]interface{}) dataMap["name"]= "于谦" dataMap["rmb"]= 123... 阅读全文
posted @ 2019-07-28 21:17 pad+ 阅读(281) 评论(0) 推荐(0) 编辑
摘要: package main import ( "encoding/json" "fmt" ) var JsonStr = `[{"hobby":["抽中华","喝牛栏山","烫花卷头"],"name":"王钢弹"}, {"hobby":["抽中华","喝茅台","烫沙宣"],"name":"王铁弹"}, {"h 阅读全文
posted @ 2019-07-28 21:15 pad+ 阅读(152) 评论(0) 推荐(0) 编辑
摘要: package main import ( "encoding/json" "fmt" ) type Persion struct { Name string Age int Rmb float64 Sex bool Hobby []string } func main01() { persion := Persion{... 阅读全文
posted @ 2019-07-26 14:06 pad+ 阅读(150) 评论(0) 推荐(0) 编辑
摘要: package main import ( "fmt" "io/ioutil" ) func main() { bytes, err := ioutil.ReadFile("C:/Users/Administrator/Desktop/测试.txt") if err != nil{ fmt.Println("文件读取失败,err=",err)... 阅读全文
posted @ 2019-07-02 21:12 pad+ 阅读(160) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 9 下一页