You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
259 B
21 lines
259 B
package value
|
|
|
|
import "gitoa.ru/go-4devs/console/input/flag"
|
|
|
|
type Any struct {
|
|
Empty
|
|
Val []interface{}
|
|
Flag flag.Flag
|
|
}
|
|
|
|
func (a *Any) Any() interface{} {
|
|
if a.Flag.IsArray() {
|
|
return a.Val
|
|
}
|
|
|
|
if len(a.Val) > 0 {
|
|
return a.Val[0]
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|