From 41f56ad05d12520bb90f91889fa979465d0b3d6b Mon Sep 17 00:00:00 2001 From: ᴜɴᴋɴᴡᴏɴ Date: Sat, 11 Apr 2020 20:18:05 +0800 Subject: login_source: migrate to GORM and add tests (#6090) * Use GORM in all write paths * Migrate to GORM * Fix lint errors * Use GORM to init table * dbutil: make writer detect error * Add more tests * Rename to clearTables * db: finish adding tests * osutil: add tests * Fix load source files path --- internal/db/errors/login_source.go | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'internal/db/errors') diff --git a/internal/db/errors/login_source.go b/internal/db/errors/login_source.go index 876a0820..db0cd1f9 100644 --- a/internal/db/errors/login_source.go +++ b/internal/db/errors/login_source.go @@ -6,19 +6,6 @@ package errors import "fmt" -type LoginSourceNotExist struct { - ID int64 -} - -func IsLoginSourceNotExist(err error) bool { - _, ok := err.(LoginSourceNotExist) - return ok -} - -func (err LoginSourceNotExist) Error() string { - return fmt.Sprintf("login source does not exist [id: %d]", err.ID) -} - type LoginSourceNotActivated struct { SourceID int64 } @@ -44,4 +31,3 @@ func IsInvalidLoginSourceType(err error) bool { func (err InvalidLoginSourceType) Error() string { return fmt.Sprintf("invalid login source type [type: %v]", err.Type) } - -- cgit v1.2.3