mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
12 lines
216 B
Go
12 lines
216 B
Go
package main
|
|
|
|
import "gorm.io/gorm"
|
|
|
|
func getUserIdGood(db *gorm.DB, name string) int64 {
|
|
var user User
|
|
if err := db.Where("name = ?", name).First(&user).Error; err != nil {
|
|
// handle errors
|
|
}
|
|
return user.Id
|
|
}
|