INNER CODE UNIT · Go

func

offen/docker-volume-backup · cmd/backup/config.go:223

func (n *WholeNumber) Decode(v string) error {
	asInt, err := strconv.Atoi(v)
	if err != nil {
		return errwrap.Wrap(nil, fmt.Sprintf("error converting %s to int", v))
	}
	if asInt < 0 {
		return errwrap.Wrap(nil, fmt.Sprintf("expected a whole, positive number, including zero. Got %d", asInt))
	}
	*n = WholeNumber(asInt)
	return nil
}

func (n *WholeNumber) Int() int {
	return int(*n)
}

type envVarLookup struct {
	ok    bool

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…