Files
gormlint/common/model_methods.go
2025-03-16 18:59:27 +07:00

11 lines
214 B
Go

package common
func (model *Model) HasPrimaryKey() bool {
for _, field := range model.Fields {
if field.Tags.HasParam("primaryKey") || field.Tags.HasOption("primaryKey") {
return true
}
}
return false
}