TerraOceanPlugin/GoBot/db_trust.go

24 lines
477 B
Go

2019-10-11 12:25:09 +07:00
package main
import "errors"
var errForceRejectionOnApprovedPerson = errors.New("db: attempt to force reject a user that is already approved")
func getTrustVote(targetID string) ([]int, error) {
rows, err := db.Query("SELECT trust FROM trustVote WHERE targetUser=?", targetID)
if err != nil {
return nil, err
}
defer rows.Close()
array := make([]int, 0)
for rows.Next() {
var trust int
rows.Scan(&trust)
array = append(array, trust)
}
return array, nil
}