mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
18 lines
365 B
Go
18 lines
365 B
Go
package flagutil
|
|
|
|
import "strings"
|
|
|
|
// Array holds an array of flag values
|
|
type Array []string
|
|
|
|
// String implements flag.Value interface
|
|
func (a *Array) String() string {
|
|
return strings.Join(*a, ",")
|
|
}
|
|
|
|
// Set implements flag.Value interface
|
|
func (a *Array) Set(value string) error {
|
|
values := strings.Split(value, ",")
|
|
*a = append(*a, values...)
|
|
return nil
|
|
}
|