diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-05-27 15:06:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-27 15:06:07 +0200 |
commit | cd1f99d063cf8bb4efdb22d2f56f1aef73ff4ba0 (patch) | |
tree | b5ad078521c36b3a155b2ced9ba5aa9f8566cb01 /vendor/github.com/onsi/gomega/internal | |
parent | 542d730987a953d8dc0a70416eaa53b218e6911b (diff) | |
parent | 61167834f296a00ab97b954bd63249ab874505c5 (diff) | |
download | podman-cd1f99d063cf8bb4efdb22d2f56f1aef73ff4ba0.tar.gz podman-cd1f99d063cf8bb4efdb22d2f56f1aef73ff4ba0.tar.bz2 podman-cd1f99d063cf8bb4efdb22d2f56f1aef73ff4ba0.zip |
Merge pull request #10483 from containers/dependabot/go_modules/github.com/onsi/gomega-1.13.0
Bump github.com/onsi/gomega from 1.12.0 to 1.13.0
Diffstat (limited to 'vendor/github.com/onsi/gomega/internal')
-rw-r--r-- | vendor/github.com/onsi/gomega/internal/defaults/env.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/vendor/github.com/onsi/gomega/internal/defaults/env.go b/vendor/github.com/onsi/gomega/internal/defaults/env.go new file mode 100644 index 000000000..bc29c63d5 --- /dev/null +++ b/vendor/github.com/onsi/gomega/internal/defaults/env.go @@ -0,0 +1,22 @@ +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) +} |