refactor: moved args to util

This commit is contained in:
Reinaldy Rafli 2021-07-09 13:39:13 +07:00
parent 75547d606a
commit 724b9432be
2 changed files with 14 additions and 0 deletions

14
util/arguments.go Normal file
View File

@ -0,0 +1,14 @@
package util
// createArgs should create an argument []interface{} for SQL query
// I'm using the idiot approach for creating args
func CreateArgs(keys ...string) []interface{} {
var args []interface{}
for _, v := range keys {
if v == "" {
continue
}
args = append(args, v)
}
return args
}