Go
69 篇笔记
- jsonhistorical
参考 bashtian/jsonutils: Converter for JSON data to a Go struct or a Java class for GSON
- packagehistorical
1. 是什么 go组织源码的方式 2. 包初始化流程 package2 test.go service.go dao.go 输出 3. 循环依赖 package1 test.go dao.go service.go 输出 可以看出 test/package1/dao 导入了 test/package1/service ,而 test/package1/service 导入了 test/package1/dao ,因此循环依赖了 4. 常
- sqlhistorical
1. 是什么 2. 有什么 2.1. 连接 DB 是线程安全的 func Open(driverName, dataSourceName string) ( DB, error) Open只是验证连接串格式,不是打开连接;需要用PING func (db DB) Ping() error 需要的时候创建连接,并验证连接是否活着 0 < MaxidleConnection < MaxOpenConnection func (db DB)
- structhistorical
1. struct比较 同类型的struct可以进行比较 比较逻辑:对每个字段进行相等性比较,如果全部相等返回 true,否则返回 false 不同类型的struct不可以比较,会报编译错误
- xormhistorical
1. reverse tool 1.1. 安装 1.2. 使用 配置文件tao.yml 命令 2. 参考 xorm/reverse: A flexsible and powerful command line tool to convert database to codes \ README\ CN\.md at master \ reverse \ Gitea: Git with a cup of tea Xorm