Skip to content

Commit

Permalink
Test missing models
Browse files Browse the repository at this point in the history
  • Loading branch information
egregius313 committed Jan 8, 2025
1 parent 55c6bea commit e7b0329
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package test

import "gorm.io/gorm"

type User struct{}

// test querying an Association
func test_gorm_AssociationQuery(association *gorm.Association) {
association.Find(&User{}) // $ source
Expand Down Expand Up @@ -42,4 +40,20 @@ func test_gorm_db(db *gorm.DB) {

db.Scan(&User{}) // $ source

var user User
db.Model(&user) // $ source

row := db.Row() // $ source
ignore(row)

rows, err := db.Rows() // $ source
ignore(err)

var user2 User
db.ScanRows(rows, &user2)

sink(user2) // $ hasTaintFlow="user2"

var names []string
db.Pluck("name", &names) // $ source
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e7b0329

Please sign in to comment.