diff options
author | Dario Maiocchi <dmaiocchi@suse.com> | 2017-11-12 18:22:37 +0100 |
---|---|---|
committer | Dario Maiocchi <dmaiocchi@suse.com> | 2017-11-16 11:26:29 +0100 |
commit | c4edcb9136cab5e05c7c688002236843913a3f7b (patch) | |
tree | 0455a0373966981669372844e9ed9fab9eb394b4 /libvirt/utils.go | |
parent | 2d00bffd3419f8235fefc101ebfc60bf1ed7ed94 (diff) | |
download | terraform-provider-libvirt-c4edcb9136cab5e05c7c688002236843913a3f7b.tar terraform-provider-libvirt-c4edcb9136cab5e05c7c688002236843913a3f7b.tar.gz |
golint on various files
Diffstat (limited to 'libvirt/utils.go')
-rw-r--r-- | libvirt/utils.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libvirt/utils.go b/libvirt/utils.go index bb2f0b3c..087d1638 100644 --- a/libvirt/utils.go +++ b/libvirt/utils.go @@ -27,8 +27,11 @@ func DiskLetterForIndex(i int) string { return fmt.Sprintf("%s%c", DiskLetterForIndex(q-1), letter) } -var waitSleepInterval = 1 * time.Second -var waitTimeout = 5 * time.Minute +// WaitSleepInterval time +var WaitSleepInterval = 1 * time.Second + +// WaitTimeout time +var WaitTimeout = 5 * time.Minute // WaitForSuccess wait for success and timeout after 5 minutes. func WaitForSuccess(errorMessage string, f func() error) error { @@ -40,8 +43,8 @@ func WaitForSuccess(errorMessage string, f func() error) error { } log.Printf("[DEBUG] %s. Re-trying.\n", err) - time.Sleep(waitSleepInterval) - if time.Since(start) > waitTimeout { + time.Sleep(WaitSleepInterval) + if time.Since(start) > WaitTimeout { return fmt.Errorf("%s: %s", errorMessage, err) } } |