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

Method Set

params.go:173–184  ·  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

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.
173func (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.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected