linter fixes

This commit is contained in:
Dylan Redding 2019-04-24 18:57:01 -05:00 committed by mergify[bot]
parent 6826694618
commit e0a1661bee
2 changed files with 8 additions and 6 deletions

View File

@ -49,18 +49,18 @@ func TestLoadExDataFromMetadataStore(t *testing.T) {
cs := &ControllerServer{
MetadataStore: &testCachePersister{
volumes: map[string]rbdVolume{
"item1": rbdVolume{
"item1": {
VolID: "1",
},
"item2": rbdVolume{
"item2": {
VolID: "2",
},
},
snapshots: map[string]rbdSnapshot{
"item1": rbdSnapshot{
"item1": {
SnapID: "1",
},
"item2": rbdSnapshot{
"item2": {
SnapID: "2",
},
},

View File

@ -408,7 +408,8 @@ func getRBDVolumeByID(volumeID string) (*rbdVolume, error) {
func getRBDVolumeByName(volName string) (*rbdVolume, error) {
for _, rbdVol := range rbdVolumes {
if rbdVol.VolName == volName {
return &rbdVol, nil
v := rbdVol
return &v, nil
}
}
return nil, fmt.Errorf("volume name %s does not exit in the volumes list", volName)
@ -417,7 +418,8 @@ func getRBDVolumeByName(volName string) (*rbdVolume, error) {
func getRBDSnapshotByName(snapName string) (*rbdSnapshot, error) {
for _, rbdSnap := range rbdSnapshots {
if rbdSnap.SnapName == snapName {
return &rbdSnap, nil
s := rbdSnap
return &s, nil
}
}
return nil, fmt.Errorf("snapshot name %s does not exit in the snapshots list", snapName)