![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
golang
国苏
这个作者很懒,什么都没留下…
展开
-
leetcode 01 golang实现
leetcode 01 golangfunc twoSum(nums []int, target int) []int { cnt := len(nums); for i := 0 ;i< cnt ;i ++{ for j:= i + 1; j < cnt ;j++{ if (nums[i] + nums[j]) == target{原创 2017-05-12 22:31:50 · 377 阅读 · 0 评论 -
golang字符串
字符串长度str := "acbd"len := len(str)第几个字符str := "abcd"first := str[0] 子串str := "abcd"sub := str[1:3]遍历 str := "abcd"for index, char := range str { fmt.Printf("%d %c\n",index,char)}连接 1.快 var原创 2017-05-22 19:58:19 · 311 阅读 · 0 评论 -
golang mysql SetMaxOpenConns SetMaxIdleConns
SetMaxOpenConns用于设置最大打开的连接数,默认值为0表示不限制。 SetMaxIdleConns用于设置闲置的连接数。db, _ = sql.Open("mysql", "root:@tcp(127.0.0.1:3306)/test?charset=utf8") db.SetMaxOpenConns(2000) db.SetMaxIdleConns(1000)原创 2017-06-18 18:32:24 · 12203 阅读 · 0 评论