MCPcopy
hub / github.com/darjun/go-daily-lib / Set

Method Set

flag/self-defined/main.go:17–29  ·  view source on GitHub ↗
(value string)

Source from the content-addressed store, hash-verified

15}
16
17func (i *interval) Set(value string) error {
18 if len(*i) > 0 {
19 return errors.New("interval flag already set")
20 }
21 for _, dt := range strings.Split(value, ",") {
22 duration, err := time.ParseDuration(dt)
23 if err != nil {
24 return err
25 }
26 *i = append(*i, duration)
27 }
28 return nil
29}
30
31var (
32 intervalFlag interval

Callers 15

mainFunction · 0.80
serveSayJSONMethod · 0.80
serveSayProtobufMethod · 0.80
writeErrorFunction · 0.80
newRequestFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected