mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-05 23:26:38 +08:00
recvcheck 7→1:6 个 GORM 模型 TableName 改为指针接收者(GORM 源码确认 reflect.New 判定 Tabler,兼容;模型单测通过)。MillisecondDuration 刻意保留(encoding/json 要求 Marshal 值/Unmarshal 指针的混合)。
Result: {"status":"keep","total_issues":9,"golint_canonicalheader":0,"golint_errname":0,"golint_errorlint":1,"golint_forcetypeassert":0,"golint_gosec":0,"golint_intrange":0,"golint_modernize":3,"golint_nilnil":3,"golint_perfsprint":0,"golint_prealloc":0,"golint_recvcheck":1,"golint_usestdlibvars":0,"golint_wastedassign":0,"golint_total":8,"eslint_problems":1,"eslint_errors":0,"eslint_warnings":1,"tsc_errors":0,"measure_s":45}
This commit is contained in:
@@ -43,7 +43,7 @@ type AuthSource struct {
|
||||
}
|
||||
|
||||
// TableName 表名
|
||||
func (AuthSource) TableName() string {
|
||||
func (*AuthSource) TableName() string {
|
||||
return "w_auth_sources"
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,6 @@ func (cv *ConfigVersion) AfterCreate(_ *gorm.DB) (err error) {
|
||||
}
|
||||
|
||||
// TableName returns the GORM table name.
|
||||
func (ConfigVersion) TableName() string {
|
||||
func (*ConfigVersion) TableName() string {
|
||||
return "of_config_versions"
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ type PushChannel struct {
|
||||
}
|
||||
|
||||
// TableName 指定 GORM 表名
|
||||
func (PushChannel) TableName() string {
|
||||
func (*PushChannel) TableName() string {
|
||||
return "w_push_channels"
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ type PushEvent struct {
|
||||
}
|
||||
|
||||
// TableName 指定 GORM 表名
|
||||
func (PushEvent) TableName() string {
|
||||
func (*PushEvent) TableName() string {
|
||||
return "w_push_events"
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ type Template struct {
|
||||
}
|
||||
|
||||
// TableName 表名
|
||||
func (Template) TableName() string {
|
||||
func (*Template) TableName() string {
|
||||
return "w_templates"
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ type User struct {
|
||||
}
|
||||
|
||||
// TableName 表名
|
||||
func (User) TableName() string {
|
||||
func (*User) TableName() string {
|
||||
return "w_users"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user