mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-27 02:46:47 +01:00
16 lines
287 B
Go
16 lines
287 B
Go
|
package httputils
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
"strings"
|
||
|
)
|
||
|
|
||
|
// GetArray returns an array of comma-separated values from r arg with the argKey name.
|
||
|
func GetArray(r *http.Request, argKey string) []string {
|
||
|
v := r.FormValue(argKey)
|
||
|
if v == "" {
|
||
|
return nil
|
||
|
}
|
||
|
return strings.Split(v, ",")
|
||
|
}
|