structs for models

This commit is contained in:
2024-12-29 23:49:46 +07:00
parent a7f82bf8f2
commit b222a44833
5 changed files with 127 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
package analyzers
package nullSafetyCheck
import (
"go/ast"
@@ -7,6 +7,7 @@ import (
"strings"
)
// NullSafetyAnalyzer todo: add URL for null safety analyzer rules
var NullSafetyAnalyzer = &analysis.Analyzer{
Name: "gormNullSafety",
Doc: "reports problems with nullable fields with unsatisfied tag",
@@ -24,7 +25,6 @@ func run(pass *analysis.Pass) (any, error) {
if !ok {
return true
}
pass.Fset.Position(structure.Pos())
if err := common.CheckUnnamedModel(*typeSpec); err != nil {
pass.Reportf(structure.Pos(), err.Error())