Files
codeql/ql/test/experimental/InconsistentCode/GORMErrorNotChecked.go
Sauyon Lee 1ffeb26a61 Add query for a GORM error not checked
co-authored-by: Sam Partington <sampart@github.com>
co-authored-by: Robin Neatherway <rneatherway@github.com>
2021-08-11 18:15:23 -07:00

10 lines
160 B
Go

package main
import "gorm.io/gorm"
func getUserId(db *gorm.DB, name string) int64 {
var user User
db.Where("name = ?", name).First(&user)
return user.Id
}