fix #2164
reviewdog [golangci] report
reported by reviewdog 🐶
Findings (0)
Filtered Findings (121)
clause/clause.go|43 col 21| Error return value of builder.WriteByte
is not checked (errcheck)
clause/clause.go|47 col 23| Error return value of builder.WriteString
is not checked (errcheck)
clause/clause.go|48 col 21| Error return value of builder.WriteByte
is not checked (errcheck)
clause/clause.go|53 col 21| Error return value of builder.WriteByte
is not checked (errcheck)
clause/delete.go|12 col 21| Error return value of builder.WriteString
is not checked (errcheck)
clause/delete.go|16 col 22| Error return value of builder.WriteString
is not checked (errcheck)
schema/field.go|824 col 16| Error return value is not checked (errcheck)
callbacks.go|107 col 16| Error return value of db.AddError
is not checked (errcheck)
callbacks.go|109 col 16| Error return value of db.AddError
is not checked (errcheck)
callbacks.go|125 col 15| Error return value of db.AddError
is not checked (errcheck)
chainable_api.go|126 col 16| Error return value of tx.AddError
is not checked (errcheck)
chainable_api.go|170 col 14| Error return value of tx.AddError
is not checked (errcheck)
finisher_api.go|58 col 15| Error return value of tx.AddError
is not checked (errcheck)
finisher_api.go|531 col 15| Error return value of tx.ScanRows
is not checked (errcheck)
statement.go|84 col 22| Error return value of writer.WriteString
is not checked (errcheck)
statement.go|103 col 20| Error return value of writer.WriteByte
is not checked (errcheck)
statement.go|113 col 20| Error return value of writer.WriteByte
is not checked (errcheck)
statement.go|118 col 21| Error return value of stmt.DB.AddError
is not checked (errcheck)
statement.go|131 col 22| Error return value of writer.WriteString
is not checked (errcheck)
statement.go|135 col 19| Error return value of writer.WriteByte
is not checked (errcheck)
statement.go|205 col 23| Error return value of writer.WriteString
is not checked (errcheck)
statement.go|440 col 18| Error return value of stmt.AddError
is not checked (errcheck)
statement.go|474 col 19| Error return value of stmt.WriteByte
is not checked (errcheck)
statement.go|584 col 19| Error return value of stmt.AddError
is not checked (errcheck)
statement.go|586 col 19| Error return value of stmt.AddError
is not checked (errcheck)
callbacks/associations.go|164 col 23| Error return value is not checked (errcheck)
callbacks/associations.go|184 col 23| Error return value is not checked (errcheck)
callbacks/callbacks.go|41 col 50| Error return value of (*gorm.io/gorm.callback).Register
is not checked (errcheck)
callbacks/callbacks.go|42 col 25| Error return value of createCallback.Register
is not checked (errcheck)
callbacks/callbacks.go|43 col 25| Error return value of createCallback.Register
is not checked (errcheck)
callbacks/callbacks.go|44 col 25| Error return value of createCallback.Register
is not checked (errcheck)
callbacks/callbacks.go|47 col 50| Error return value of (*gorm.io/gorm.callback).Register
is not checked (errcheck)
callbacks/callbacks.go|51 col 24| Error return value of queryCallback.Register
is not checked (errcheck)
callbacks/callbacks.go|52 col 24| Error return value of queryCallback.Register
is not checked (errcheck)
callbacks/callbacks.go|53 col 24| Error return value of queryCallback.Register
is not checked (errcheck)
callbacks/callbacks.go|57 col 50| Error return value of (*gorm.io/gorm.callback).Register
is not checked (errcheck)
callbacks/callbacks.go|58 col 25| Error return value of deleteCallback.Register
is not checked (errcheck)
callbacks/callbacks.go|59 col 25| Error return value of deleteCallback.Register
is not checked (errcheck)
callbacks/callbacks.go|60 col 25| Error return value of deleteCallback.Register
is not checked (errcheck)
callbacks/callbacks.go|67 col 25| Error return value of updateCallback.Register
is not checked (errcheck)
callbacks/callbacks.go|68 col 25| Error return value of updateCallback.Register
is not checked (errcheck)
callbacks/callbacks.go|69 col 25| Error return value of updateCallback.Register
is not checked (errcheck)
callbacks/callbacks.go|77 col 22| Error return value of rowCallback.Register
is not checked (errcheck)
callbacks/callbacks.go|81 col 22| Error return value of rawCallback.Register
is not checked (errcheck)
migrator/migrator.go|317 col 16| Error return value of m.RunWithValue
is not checked (errcheck)
migrator/migrator.go|404 col 16| Error return value of m.RunWithValue
is not checked (errcheck)
migrator/migrator.go|718 col 16| Error return value of m.RunWithValue
is not checked (errcheck)
migrator/migrator.go|836 col 42| Error return value of (*database/sql.Row).Scan
is not checked (errcheck)
clause/expression.go|127 col 3| ifElseChain: rewrite if-else to switch statement (gocritic)
clause/expression.go|105 col 5| singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
schema/field.go|283 col 3| ifElseChain: rewrite if-else to switch statement (gocritic)
schema/field.go|295 col 3| ifElseChain: rewrite if-else to switch statement (gocritic)
finisher_api.go|273 col 5| singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
logger/sql_test.go|11| File is not goimports
-ed with -local gorm.io/gorm (goimports)
schema/field.go|14| File is not goimports
-ed with -local gorm.io/gorm (goimports)
schema/relationship.go|9| File is not goimports
-ed with -local gorm.io/gorm (goimports)
schema/naming.go|4 col 2| G505: Blocklisted import crypto/sha1: weak cryptographic primitive (gosec)
schema/naming.go|98 col 8| G401: Use of weak cryptographic primitive (gosec)
schema/schema_helper_test.go|167 col 39| G601: Implicit memory aliasing in for loop. (gosec)
schema/schema_test.go|50 col 29| G601: Implicit memory aliasing in for loop. (gosec)
schema/schema_test.go|140 col 29| G601: Implicit memory aliasing in for loop. (gosec)
schema/relationship.go|231 col 2| Consider pre-allocating joinTableFields
(prealloc)
callbacks.go|248 col 2| Consider pre-allocating names
(prealloc)
migrator/migrator.go|621 col 2| Consider pre-allocating foreignKeys
(prealloc)
logger/sql_test.go|33 col 23| format
- escaper
always receives "
("\""
) (unparam)
callbacks/associations.go|321| unnecessary trailing newline (whitespace)
callbacks/delete.go|109| unnecessary trailing newline (whitespace)
migrator/migrator.go|395| unnecessary trailing newline (whitespace)
clause/expression.go|28 col 1| calculated cyclomatic complexity for function Build is 15, max is 10 (cyclop)
clause/expression.go|85 col 1| calculated cyclomatic complexity for function Build is 37, max is 10 (cyclop)
clause/where.go|37 col 1| calculated cyclomatic complexity for function buildExprs is 19, max is 10 (cyclop)
logger/logger.go|153 col 1| calculated cyclomatic complexity for function Trace is 13, max is 10 (cyclop)
logger/sql.go|38 col 1| calculated cyclomatic complexity for function ExplainSQL is 47, max is 10 (cyclop)
migrator/migrator.go|112 col 1| calculated cyclomatic complexity for function AutoMigrate is 27, max is 10 (cyclop)
migrator/migrator.go|206 col 1| calculated cyclomatic complexity for function CreateTable is 23, max is 10 (cyclop)
migrator/migrator.go|439 col 1| calculated cyclomatic complexity for function MigrateColumn is 42, max is 10 (cyclop)
migrator/migrator.go|634 col 1| calculated cyclomatic complexity for function GuessConstraintAndTable is 14, max is 10 (cyclop)
migrator/migrator.go|841 col 1| calculated cyclomatic complexity for function ReorderModels is 22, max is 10 (cyclop)
utils/tests/dummy_dialecter.go|42 col 1| calculated cyclomatic complexity for function QuoteTo is 14, max is 10 (cyclop)
utils/tests/utils.go|30 col 1| calculated cyclomatic complexity for function AssertEqual is 25, max is 10 (cyclop)
association.go|75 col 1| calculated cyclomatic complexity for function Replace is 30, max is 10 (cyclop)
association.go|197 col 1| calculated cyclomatic complexity for function Delete is 35, max is 10 (cyclop)
association.go|380 col 1| calculated cyclomatic complexity for function saveAssociation is 51, max is 10 (cyclop)
callbacks.go|75 col 1| calculated cyclomatic complexity for function Execute is 25, max is 10 (cyclop)
callbacks.go|247 col 1| calculated cyclomatic complexity for function sortCallbacks is 34, max is 10 (cyclop)
chainable_api.go|112 col 1| calculated cyclomatic complexity for function Select is 18, max is 10 (cyclop)
finisher_api.go|73 col 1| calculated cyclomatic complexity for function Save is 16, max is 10 (cyclop)
finisher_api.go|174 col 1| calculated cyclomatic complexity for function FindInBatches is 17, max is 10 (cyclop)
finisher_api.go|246 col 1| calculated cyclomatic complexity for function assignInterfacesToValue is 21, max is 10 (cyclop)
finisher_api.go|346 col 1| calculated cyclomatic complexity for function FirstOrCreate is 12, max is 10 (cyclop)
finisher_api.go|438 col 1| calculated cyclomatic complexity for function Count is 18, max is 10 (cyclop)
finisher_api.go|616 col 1| calculated cyclomatic complexity for function Transaction is 11, max is 10 (cyclop)
gorm.go|121 col 1| calculated cyclomatic complexity for function Open is 23, max is 10 (cyclop)
gorm.go|218 col 1| calculated cyclomatic complexity for function Session is 21, max is 10 (cyclop)
gorm.go|376 col 1| calculated cyclomatic complexity for function DB is 11, max is 10 (cyclop)
scan.go|53 col 1| calculated cyclomatic complexity for function scanIntoStruct is 15, max is 10 (cyclop)
scan.go|125 col 1| calculated cyclomatic complexity for function Scan is 66, max is 10 (cyclop)
statement.go|81 col 1| calculated cyclomatic complexity for function QuoteTo is 23, max is 10 (cyclop)
statement.go|169 col 1| calculated cyclomatic complexity for function AddVar is 25, max is 10 (cyclop)
statement.go|284 col 1| calculated cyclomatic complexity for function BuildCondition is 70, max is 10 (cyclop)
statement.go|560 col 1| calculated cyclomatic complexity for function SetColumn is 16, max is 10 (cyclop)
statement.go|616 col 1| calculated cyclomatic complexity for function Changed is 18, max is 10 (cyclop)
statement.go|671 col 1| calculated cyclomatic complexity for function SelectAndOmitColumns is 23, max is 10 (cyclop)
callbacks/associations.go|13 col 1| calculated cyclomatic complexity for function SaveBeforeAssociations is 30, max is 10 (cyclop)
callbacks/associations.go|110 col 1| calculated cyclomatic complexity for function SaveAfterAssociations is 74, max is 10 (cyclop)
callbacks/associations.go|378 col 1| calculated cyclomatic complexity for function saveAssociations is 11, max is 10 (cyclop)
callbacks/create.go|37 col 1| calculated cyclomatic complexity for function Create is 33, max is 10 (cyclop)
callbacks/create.go|177 col 1| calculated cyclomatic complexity for function ConvertToCreateValues is 73, max is 10 (cyclop)
callbacks/delete.go|26 col 1| calculated cyclomatic complexity for function DeleteBeforeAssociations is 24, max is 10 (cyclop)
callbacks/delete.go|113 col 1| calculated cyclomatic complexity for function Delete is 16, max is 10 (cyclop)
callbacks/helper.go|43 col 1| calculated cyclomatic complexity for function ConvertSliceOfMapToValuesForCreate is 14, max is 10 (cyclop)
callbacks/preload.go|106 col 1| calculated cyclomatic complexity for function preload is 36, max is 10 (cyclop)
callbacks/query.go|33 col 1| calculated cyclomatic complexity for function BuildQuerySQL is 62, max is 10 (cyclop)
callbacks/update.go|56 col 1| calculated cyclomatic complexity for function Update is 12, max is 10 (cyclop)
callbacks/update.go|131 col 1| calculated cyclomatic complexity for function ConvertToAssignments is 78, max is 10 (cyclop)
schema/field.go|97 col 1| calculated cyclomatic complexity for function ParseField is 120, max is 10 (cyclop)
schema/field.go|437 col 1| calculated cyclomatic complexity for function setupValuerAndSetter is 199, max is 10 (cyclop)
schema/index.go|30 col 1| calculated cyclomatic complexity for function ParseIndexes is 14, max is 10 (cyclop)
schema/naming.go|116 col 83| SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck)
schema/naming.go|181 col 31| SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck)
schema/naming.go|183 col 31| SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck)