git记住用户名密码
git config –global credential.helper store pull一次… 继续阅读 git记住用户名密码
git config –global credential.helper store pull一次… 继续阅读 git记住用户名密码
env: go env -w GOPRIVATE=”hub.my.com” //配置私有仓库域名 g… 继续阅读 go mod私有仓库环境变量
https://github.com/open-dating/adult-image-detecto… 继续阅读 docker run adult-image-detector图像内容检测
s := “abcdefg” fmt.Println(s[0:6]) //包含起始位置,不包含结束位… 继续阅读 golang字符串截取
res := make(map[string]interface{}) dataType , _ :… 继续阅读 map[string]interface{} 转为string
nowTime := time.Now() year := time.Now().Year() mo… 继续阅读 golang time.Now()格式化
//db, err = gorm.Open(“mysql”, “root:password@tcp(… 继续阅读 gorm使用连接池
package util import ( “gorm.io/driver/sqlite” “gor… 继续阅读 gorm 使用内存中的SQLite
db.Create(&user) // 将 `CreatedAt` 设为当前时间 // 想要… 继续阅读 gorm自定义CreatedAt值
type Student struct { Age int64 `gorm:”column:his_… 继续阅读 gorm自定字段名
type Blog struct { ID int Author Author `gorm:”emb… 继续阅读 gorm字段使用自定义前缀
解决办法: root:123456@tcp(127.0.0.1:3306)/testdb?chars… 继续阅读 Scan error on column index 1, name “created_at”: unsupported Scan, storing driver.Value type []uint8
newUser := model.User{ Phone: phone, Password: str… 继续阅读 gorm insert捕获失败情况
update t1 set ArrivalDate=date_add(ArrivalDate, in… 继续阅读 mysql data_time增加天数
$ kill -l 1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL… 继续阅读 kill信号列表
func main() { router := gin.Default() // 为 multipa… 继续阅读 gin router 限制multipart forms内存
//默认0表示不限制 db.DB().SetMaxIdleConns(2000) db.DB().S… 继续阅读 gorm设置最大连接数和最大闲置数
db.Set(“grom:table_options”, “ENGINE=InnoDB”)
// 如果设置为true,`User`的默认表名为`user`,使用`TableName`设置的表名… 继续阅读 gorm全局禁用表名复数
db.LogMode(true)