禁用mysql 的prepare

user:password@tcp(db.hostname:3306)/db_name?charset=utf8mb4&interpolateParams=true

获取调用函数的函数名

func printCallerName() string {
    pc, _, _, _ := runtime.Caller(2)
    return runtime.FuncForPC(pc).Name()
}

mysql limit 优化

前提: id 是主键,并且是 int
例如将
select id,name from student limit 1000000,10;
改写成(延迟join 的特性)
SELECT id,name FROM student INNER JOIN
(SELECT id FROM student LIMIT 1000000,10) AS stu ON student.id = stu.id;
或者
select id,name from student where id > xxxx limit 10;

golang 完全静态编译

CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o main .

*"Go网络编程——Socket"
http://tonybai.com/2015/11/17/tcp-programming-in-golang

*"015_understanding-TCP-servers"
https://github.com/GoesToEleven/golang-web-dev/tree/master/015_understanding-TCP-servers

*"AppliedGo/networking"
https://appliedgo.net/networking/

*"TCP servers that run like clockwork"
https://sahilm.com/tcp-servers-that-run-like-clockwork/
https://github.com/sahilm/shouter

*"ardanlabs/kit/tcp"
https://github.com/ardanlabs/kit/tree/master/tcp
https://github.com/ardanlabs/kit/tree/master/examples/tcp

*"Golang实现简单tcp服务器"
"01 -- 概述" http://studygolang.com/articles/3184
"02 -- 实现echo服务器/客户端" http://studygolang.com/articles/3183
"03 -- 文本广播式聊天服务器/客户端" http://studygolang.com/articles/3182
"04 -- 服务器的粘包处理" http://studygolang.com/articles/3181
"golang -- TCP服务器(2)" https://my.oschina.net/1123581321/blog/192442#comment-list

*"zero——Go实现轻量级的Tcp服务器"
https://www.jianshu.com/p/f20cd2304aea
https://github.com/9b9387/zero

*"从零开始写Socket Server"
"(1): Socket-Client框架 " http://blog.csdn.net/ahlxt123/article/details/47320161

"(2): 自定义通讯协议" http://blog.csdn.net/ahlxt123/article/details/47396509

"(3): 对长、短连接的处理策略(模拟心跳)" http://blog.csdn.net/ahlxt123/article/details/47726783

"(4):将运行参数放入配置文件(XML/YAML)" http://blog.csdn.net/ahlxt123/article/details/47970997

"(5):Server的解耦—通过Router+Controller实现逻辑分发" http://blog.csdn.net/ahlxt123/article/details/48178121

"(6)【完结】:日志模块的设计与定时任务模块模块" http://blog.csdn.net/ahlxt123/article/details/49202571

https://github.com/gislu/goSocket

*"gotcp"
https://github.com/gansidui/gotcp
"tao"
https://github.com/leesper/tao
"Tao - Go语言实现的TCP网络编程框架"
http://www.jianshu.com/p/c322edca985f

*"teleport"
https://github.com/henrylee2cn/teleport
"Go Socket编程之teleport框架是怎样炼成的"
https://www.jianshu.com/p/7120b8378681

awesome-go https://awesome-go.com/

slice常用包 github.com/elliotchance/pie
爬虫框架 github.com/gocolly/colly
单元测试 github.com/smartystreets/goconvey
速率限制 gopkg.in/bsm/ratelimit.v1
解析html github.com/PuerkitoBio/goquery
生成二维码 github.com/skip2/go-qrcode
识别二维码 github.com/PeterCxy/gozbar
文本识别 github.com/otiai10/gosseract
对象池 github.com/jolestar/go-commons-pool
连接池 gopkg.in/fatih/pool.v2
验证码 github.com/dchest/captcha
excel(xlsx) github.com/Luxurioust/excelize
邮件 gopkg.in/gomail.v1
redis github.com/go-redis/redis
mysql github.com/go-sql-driver/mysql
mssql github.com/denisenkom/go-mssqldb
mq协议 github.com/gmallard/stompngo
hive github.com/araddon/hive
csv github.com/go-hep/csvutil
websocket github.com/gorilla/websocket
socketio github.com/graarh/golang-socketio
msgpack github.com/vmihailenco/msgpack
dsn解析 github.com/phonkee/godsn
cli接口 github.com/spf13/cobra
uuid github.com/satori/go.uuid
消息队列 github.com/go-msgqueue/msgqueue
mysql Orm github.com/jmoiron/sqlx
Ethernet frames github.com/mdlayher/raw
内存数据库 github.com/HouzuoGuo/tiedot
GUI github.com/andlabs/ui
windowsGui github.com/lxn/walk
windws Gui github.com/fyne-io/fyne
terminal-ui github.com/marcusolsson/tui-go
env解析 github.com/joho/godotenv
json去除注释 github.com/DisposaBoy/JsonConfigReader
markdown 解析 github.com/russross/blackfriday
windows 提示 github.com/gen2brain/beeep
协程管理 gopkg.in/tomb.v2
层级时间轮 github.com/RussellLuo/timingwheel
文件类型 github.com/h2non/filetype
app with html5 github.com/zserge/lorca
windows com调用 github.com/go-ole/go-ole
数据校验 github.com/asaskevich/govalidator
template 常用函数集合 github.com/Masterminds/sprig
testcontainer github.com/testcontainers/testcontainers-go
单元测试 github.com/stretchr/testify
类型转换 github.com/spf13/cast

2018-11-06 本博客启用

2018-11-18 vps 挂了。。。7号到 18 号的数据丢失了。。。(备份还是很重要的。。)

博客内容均来自互联网,如若侵权,望告知,立刻删除!