The `LVMVolumeGroup.Clone()` method could end up dereferencing a `nil` pointer in the `lv` variable, if there would be a `nil` logical volume in the LVM volume group. Such situation would be an error of its own. There is no point in checking if the cloned logical volume is not `nil` and casting it to another variable. The logic should check if the cloned logical volume is `nil` and panic in such situation. The following code can then cast the clone to a different variable without issues and there is no risk of dereferencing a `nil` pointer. Signed-off-by: Tomáš Hozza <thozza@redhat.com> |
||
|---|---|---|
| .. | ||
| btrfs.go | ||
| disk.go | ||
| disk_test.go | ||
| filesystem.go | ||
| luks.go | ||
| lvm.go | ||
| lvm_test.go | ||
| partition.go | ||
| partition_table.go | ||
| path_policy.go | ||
| path_policy_test.go | ||
| path_tree_test.go | ||
| path_trie.go | ||