24 lines
477 B
Go
24 lines
477 B
Go
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
|
|
}
|