From dff6cf1a83d9be8ea211f150db2c60d875ddafb9 Mon Sep 17 00:00:00 2001 From: Clint Shryock Date: Mon, 22 Jun 2015 10:48:54 -0500 Subject: [PATCH] code tweak after review --- builder/amazon/ebs/step_cleanup_volumes.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/builder/amazon/ebs/step_cleanup_volumes.go b/builder/amazon/ebs/step_cleanup_volumes.go index c66f9d786..56ebe5527 100644 --- a/builder/amazon/ebs/step_cleanup_volumes.go +++ b/builder/amazon/ebs/step_cleanup_volumes.go @@ -43,16 +43,17 @@ func (s *stepCleanupVolumes) Cleanup(state multistep.StateBag) { ui.Say("Cleaning up any extra volumes...") - save := make(map[string]bool) + // We don't actually care about the value here, but we need Set behavior + save := make(map[string]struct{}) for _, b := range s.BlockDevices.AMIMappings { if !b.DeleteOnTermination { - save[b.DeviceName] = true + save[b.DeviceName] = struct{}{} } } for _, b := range s.BlockDevices.LaunchMappings { if !b.DeleteOnTermination { - save[b.DeviceName] = true + save[b.DeviceName] = struct{}{} } }