feat: references check
... and fixes: parse fields without tags and other logical errors
This commit is contained in:
19
tests/testdata/src/references_check/positive.go
vendored
Normal file
19
tests/testdata/src/references_check/positive.go
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
package references_check
|
||||
|
||||
type User struct {
|
||||
Name string
|
||||
CompanyID string
|
||||
Company Company `gorm:"references:code"` // want "Related field \"code\" doesn't exist on model \"Company\""
|
||||
}
|
||||
|
||||
type Company struct {
|
||||
ID int
|
||||
Code string
|
||||
Name string
|
||||
}
|
||||
|
||||
type Order struct {
|
||||
Id uint `gorm:"primaryKey"`
|
||||
CompanyID string `gorm:"references:Code"` // want "Related model \"string\" doesn't exist"
|
||||
Company Company
|
||||
}
|
||||
Reference in New Issue
Block a user