[FEATURE] Detailed stats about player weapon usage and hitgroups (#1)
Reviewed-on: https://git.harting.dev/CSGOWTF/csgowtfd/pulls/1 Co-authored-by: Giovanni Harting <539@idlegandalf.com> Co-committed-by: Giovanni Harting <539@idlegandalf.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"csgowtfd/ent/match"
|
||||
"csgowtfd/ent/player"
|
||||
"csgowtfd/ent/stats"
|
||||
"csgowtfd/ent/weaponstats"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
@@ -31,9 +32,10 @@ type OrderFunc func(*sql.Selector)
|
||||
// columnChecker returns a function indicates if the column exists in the given column.
|
||||
func columnChecker(table string) func(string) error {
|
||||
checks := map[string]func(string) bool{
|
||||
match.Table: match.ValidColumn,
|
||||
player.Table: player.ValidColumn,
|
||||
stats.Table: stats.ValidColumn,
|
||||
match.Table: match.ValidColumn,
|
||||
player.Table: player.ValidColumn,
|
||||
stats.Table: stats.ValidColumn,
|
||||
weaponstats.Table: weaponstats.ValidColumn,
|
||||
}
|
||||
check, ok := checks[table]
|
||||
if !ok {
|
||||
|
Reference in New Issue
Block a user