mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-09-10 01:27:54 +00:00
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.12.0 to 1.13.0. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.12.0...v1.13.0) Signed-off-by: dependabot[bot] <support@github.com>
22 lines
431 B
Go
22 lines
431 B
Go
package defaults
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
)
|
|
|
|
func SetDurationFromEnv(getDurationFromEnv func(string) string, varSetter func(time.Duration), name string) {
|
|
durationFromEnv := getDurationFromEnv(name)
|
|
|
|
if len(durationFromEnv) == 0 {
|
|
return
|
|
}
|
|
|
|
duration, err := time.ParseDuration(durationFromEnv)
|
|
|
|
if err != nil {
|
|
panic(fmt.Sprintf("Expected a duration when using %s! Parse error %v", name, err))
|
|
}
|
|
|
|
varSetter(duration)
|
|
}
|