Set is the method to set the param value, part of the flag.Value interface. Set's argument is a string to be parsed to set the param. It's a comma-separated list, so we split it.
(value string)
| 171 | // Set's argument is a string to be parsed to set the param. |
| 172 | // It's a comma-separated list, so we split it. |
| 173 | func (s *SInt) Set(value string) error { |
| 174 | for _, dt := range strings.Split(value, ",") { |
| 175 | if len(dt) > 0 { |
| 176 | parsed, err := strconv.ParseInt(dt, 0, 64) |
| 177 | if err != nil { |
| 178 | return err |
| 179 | } |
| 180 | *s = append(*s, int(parsed)) |
| 181 | } |
| 182 | } |
| 183 | return nil |
| 184 | } |
| 185 | |
| 186 | // SliceInt defines a multi-value int param with specified name and default value. |
| 187 | // The return value is the address of a SInt variable that stores the values of the param. |
nothing calls this directly
no outgoing calls
no test coverage detected