在这里,做一个简单的问题记录:
connStr := fmt.Sprintf("%s:%s@(%s:%d)/%s?charset=utf8mb4&loc=Local", conf.DB.UserName, conf.DB.UserPasswd,
conf.DB.DbIP, conf.DB.DbPort, conf.DB.DbName)
问题: 为什么&loc=Local不生效?
答:少了一段配置:&parseTime=True
connStr := fmt.Sprintf("%s:%s@(%s:%d)/%s?charset=utf8mb4&parseTime=True&loc=Local", conf.DB.UserName, conf.DB.UserPasswd,
conf.DB.DbIP, conf.DB.DbPort, conf.DB.DbName)