added empty query checks
This commit is contained in:
parent
3b458f6ff1
commit
0e2b25e788
3 changed files with 31 additions and 5 deletions
13
helper.go
13
helper.go
|
|
@ -21,6 +21,19 @@ func checkFields(s []string, val string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func clearFields(s string) []string {
|
||||
a := strings.Split(s, " ")
|
||||
b := make([]string, len(a))
|
||||
c := 0
|
||||
for _, v := range a {
|
||||
if v != "" {
|
||||
b[c] = v
|
||||
c++
|
||||
}
|
||||
}
|
||||
return b[:c]
|
||||
}
|
||||
|
||||
type less func(i, j int) bool
|
||||
|
||||
func reverse(f less) less {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue