Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(scan.go): reflect.MakeSlice may pass in the wrong type reflect.Array #6880

Merged
merged 1 commit into from Mar 9, 2024

fix(scan.go): reflect.MakeSlice passes in the reflect.Array type

fe77d2e
Select commit
Failed to load commit list.
Sign in for the full log view
Merged

fix(scan.go): reflect.MakeSlice may pass in the wrong type reflect.Array #6880

fix(scan.go): reflect.MakeSlice passes in the reflect.Array type
fe77d2e
Select commit
Failed to load commit list.
GitHub Actions / golangci succeeded Mar 7, 2024 in 0s

reviewdog [golangci] report

reported by reviewdog 🐶

Findings (0)
Filtered Findings (120)

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|832 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|535 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|436 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)
migrator/migrator.go|325 col 16| Error return value of m.RunWithValue is not checked (errcheck)
migrator/migrator.go|412 col 16| Error return value of m.RunWithValue is not checked (errcheck)
migrator/migrator.go|744 col 16| Error return value of m.RunWithValue is not checked (errcheck)
migrator/migrator.go|860 col 42| Error return value of (*database/sql.Row).Scan 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)
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|291 col 3| ifElseChain: rewrite if-else to switch statement (gocritic)
schema/field.go|303 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|106 col 8| G401: Use of weak cryptographic primitive (gosec)
schema/schema_test.go|178 col 36| G601: Implicit memory aliasing in for loop. (gosec)
schema/schema_test.go|219 col 35| G601: Implicit memory aliasing in for loop. (gosec)
schema/schema_test.go|287 col 35| G601: Implicit memory aliasing in for loop. (gosec)
schema/relationship.go|266 col 2| Consider pre-allocating joinTableFields (prealloc)
callbacks.go|248 col 2| Consider pre-allocating names (prealloc)
logger/sql_test.go|33 col 23| format - escaper always receives " ("\"") (unparam)
migrator/migrator.go|404 col 3| unnecessary trailing newline (whitespace)
callbacks/associations.go|322 col 7| unnecessary trailing newline (whitespace)
callbacks/delete.go|110 col 2| 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|43 col 1| calculated cyclomatic complexity for function buildExprs is 19, max is 10 (cyclop)
clause/where.go|168 col 1| calculated cyclomatic complexity for function Build is 21, 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|120 col 1| calculated cyclomatic complexity for function AutoMigrate is 26, max is 10 (cyclop)
migrator/migrator.go|209 col 1| calculated cyclomatic complexity for function CreateTable is 24, max is 10 (cyclop)
migrator/migrator.go|447 col 1| calculated cyclomatic complexity for function MigrateColumn is 41, max is 10 (cyclop)
migrator/migrator.go|865 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 13, max is 10 (cyclop)
finisher_api.go|442 col 1| calculated cyclomatic complexity for function Count is 18, max is 10 (cyclop)
finisher_api.go|620 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|685 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 43, max is 10 (cyclop)
callbacks/create.go|217 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|160 col 1| calculated cyclomatic complexity for function preload is 36, max is 10 (cyclop)
callbacks/query.go|32 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|105 col 1| calculated cyclomatic complexity for function ParseField is 120, max is 10 (cyclop)
schema/field.go|445 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/index.go|95 col 1| calculated cyclomatic complexity for function parseFieldIndexes is 14, max is 10 (cyclop)
schema/naming.go|124 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|189 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|191 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)