diff options
author | Dario Maiocchi <dmaiocchi@suse.com> | 2017-11-09 19:47:35 +0100 |
---|---|---|
committer | Dario Maiocchi <dmaiocchi@suse.com> | 2017-11-16 11:26:28 +0100 |
commit | 3d306829f3b1ce9d598222a0bc1fecb05e0c39ef (patch) | |
tree | f0cecbc483b7e30e5e59bc5fabc494c404f22aa4 | |
parent | 7998643f5e518ee57c02bd34eebdbe3ed501112d (diff) | |
download | terraform-provider-libvirt-3d306829f3b1ce9d598222a0bc1fecb05e0c39ef.tar terraform-provider-libvirt-3d306829f3b1ce9d598222a0bc1fecb05e0c39ef.tar.gz |
fix golint on libvirt/utils_volume.go
-rw-r--r-- | libvirt/utils_volume.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libvirt/utils_volume.go b/libvirt/utils_volume.go index 1c97cff7..457bacb9 100644 --- a/libvirt/utils_volume.go +++ b/libvirt/utils_volume.go @@ -50,15 +50,15 @@ func (i *localImage) Import(copier func(io.Reader) error, vol libvirtxml.Storage return fmt.Errorf("Error while opening %s: %s", i.path, err) } - if fi, err := file.Stat(); err != nil { + fi, err := file.Stat() + if err != nil { return err - } else { - // we can skip the upload if the modification times are the same - if vol.Target.Timestamps != nil && vol.Target.Timestamps.Mtime != "" { - if fi.ModTime() == timeFromEpoch(vol.Target.Timestamps.Mtime) { - log.Printf("Modification time is the same: skipping image copy") - return nil - } + } + // we can skip the upload if the modification times are the same + if vol.Target.Timestamps != nil && vol.Target.Timestamps.Mtime != "" { + if fi.ModTime() == timeFromEpoch(vol.Target.Timestamps.Mtime) { + log.Printf("Modification time is the same: skipping image copy") + return nil } } |