MCPcopy Create free account
hub / github.com/VividCortex/siesta / Set

Method Set

params.go:220–231  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

218// Set's argument is a string to be parsed to set the param.
219// It's a comma-separated list, so we split it.
220func (s *SInt64) Set(value string) error {
221 for _, dt := range strings.Split(value, ",") {
222 if len(dt) > 0 {
223 parsed, err := strconv.ParseInt(dt, 0, 64)
224 if err != nil {
225 return err
226 }
227 *s = append(*s, int64(parsed))
228 }
229 }
230 return nil
231}
232
233// SliceInt64 defines a multi-value int64 param with specified name and default value.
234// The return value is the address of a SInt64 variable that stores the values of the param.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected