diff options
author | Dario Maiocchi <dmaiocchi@suse.com> | 2017-11-10 19:32:40 +0100 |
---|---|---|
committer | Dario Maiocchi <dmaiocchi@suse.com> | 2017-11-16 11:26:28 +0100 |
commit | 4a6eb4f8fe6addef884ffa2e382f52ee235e3697 (patch) | |
tree | b6b2384f5afb6fedfb96cccfa9db3b4290a0724c | |
parent | 82de366ef73673f301b36f8c8846b05fd56d0790 (diff) | |
download | terraform-provider-libvirt-4a6eb4f8fe6addef884ffa2e382f52ee235e3697.tar terraform-provider-libvirt-4a6eb4f8fe6addef884ffa2e382f52ee235e3697.tar.gz |
fix golint issues on utils.go
-rw-r--r-- | libvirt/utils.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libvirt/utils.go b/libvirt/utils.go index a0dea21c..0660abeb 100644 --- a/libvirt/utils.go +++ b/libvirt/utils.go @@ -11,8 +11,8 @@ import ( libvirt "github.com/libvirt/libvirt-go" ) -var diskLetters []rune = []rune("abcdefghijklmnopqrstuvwxyz") - +var diskLetters = []rune("abcdefghijklmnopqrstuvwxyz") +// DiskLetterForIndex return diskLetters for index func DiskLetterForIndex(i int) string { q := i / len(diskLetters) @@ -26,8 +26,8 @@ func DiskLetterForIndex(i int) string { return fmt.Sprintf("%s%c", DiskLetterForIndex(q-1), letter) } -var WAIT_SLEEP_INTERVAL time.Duration = 1 * time.Second -var WAIT_TIMEOUT time.Duration = 5 * time.Minute +var waitSleepInterval = 1 * time.Second +var waitTimeout = 5 * time.Minute // WaitForSuccess wait for success and timeout after 5 minutes. func WaitForSuccess(errorMessage string, f func() error) error { @@ -39,8 +39,8 @@ func WaitForSuccess(errorMessage string, f func() error) error { } log.Printf("[DEBUG] %s. Re-trying.\n", err) - time.Sleep(WAIT_SLEEP_INTERVAL) - if time.Since(start) > WAIT_TIMEOUT { + time.Sleep(waitSleepInterval) + if time.Since(start) > waitTimeout { return fmt.Errorf("%s: %s", errorMessage, err) } } |