mirror of https://github.com/aldy505/bob.git
refactor: moved args to util
This commit is contained in:
parent
75547d606a
commit
724b9432be
|
@ -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
|
||||
}
|
Loading…
Reference in New Issue