MCPcopy Create free account
hub / github.com/docker/cli / parseCount

Function parseCount

opts/gpus.go:18–31  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

16}
17
18func parseCount(s string) (int, error) {
19 if s == "all" {
20 return -1, nil
21 }
22 i, err := strconv.Atoi(s)
23 if err != nil {
24 var numErr *strconv.NumError
25 if errors.As(err, &numErr) {
26 err = numErr.Err
27 }
28 return 0, fmt.Errorf(`invalid count (%s): value must be either "all" or an integer: %w`, s, err)
29 }
30 return i, nil
31}
32
33// Set a new mount value
34//

Callers 1

SetMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…