06 2021 档案
摘要:T表示分隔符,Z表示的是UTC。UTC:世界标准时间,在标准时间上加上8小时,即东八区时间,也就是北京时间。 北京时间:2020-01-14 00:00:00对应的国际标准时间格式为:2020-01-13T16:00:00.000Z
阅读全文
摘要:Column 'created_at' in order clause is ambiguous 多表查时需要指定是哪个表的created_at
阅读全文
摘要:Unhandled promise rejection {errMsg: "navigateTo:fail webview count limit exceed"}(env: macOS,mp,1.05.2105170; lib: 2.17.0)
阅读全文
摘要:对于正常的结构体字段,你也可以通过标签 embedded 将其嵌入,例如type Author struct { Name string Email string } type Blog struct { ID int Author Author `gorm:"embedded"` Upvotes
阅读全文
摘要:type User struct { Name string `gorm:"size:255"` //string默认长度255,size重设长度 Age int `gorm:"column:my_age"` //设置列名为my_age Num int `gorm:"AUTO_INCREMENT"`
阅读全文
摘要:JSON Tag 的简单应用 - 自定义字段名,去掉空值字段 默认情况下,结构体序列化后的字段名和结构体的字段名保持一致,如在结构体中定义了对外公开的字段,字段名首字母都是大写的,JSON 序列化后得到的也是首字母大写的字段名,并不符合日常开发习惯。 其实 go 提供了在结构体中使用 JSON Ta
阅读全文