Merge pull request #4479 from wuwenchi/master

Fix document for Pluck's usage #4473
This commit is contained in:
Jason Lee 2021-06-27 11:29:20 +08:00 committed by GitHub
commit 6d64e31965
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -474,7 +474,7 @@ func (db *DB) Scan(dest interface{}) (tx *DB) {
// Pluck used to query single column from a model as a map // Pluck used to query single column from a model as a map
// var ages []int64 // var ages []int64
// db.Find(&users).Pluck("age", &ages) // db.Model(&users).Pluck("age", &ages)
func (db *DB) Pluck(column string, dest interface{}) (tx *DB) { func (db *DB) Pluck(column string, dest interface{}) (tx *DB) {
tx = db.getInstance() tx = db.getInstance()
if tx.Statement.Model != nil { if tx.Statement.Model != nil {