Files
gormlint/common/unnamedChecks.go
GogaCoder 03ccaff375 feat: foreignKeys check
+fix: "unnamed" field bug
2024-12-30 23:44:24 +07:00

15 lines
205 B
Go

package common
import (
"errors"
"fmt"
"go/ast"
)
func CheckUnnamedModel(typeSpec ast.TypeSpec) error {
if typeSpec.Name == nil {
return errors.New(fmt.Sprintf("Unnamed model\n"))
}
return nil
}