Skip to content

Commit

Permalink
Improve variable naming for placement matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
spangenberg committed Nov 7, 2018
1 parent 9647f68 commit 98b836b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/cloud/aws/actuators/machine/actuator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -522,22 +522,22 @@ func mockRunInstancesForPlacement(mockAWSClient *mockaws.MockClient, availabilit
}

type placementMatcher struct {
x *ec2.Placement
placement *ec2.Placement
}

func (m placementMatcher) Matches(x interface{}) bool {
input, ok := x.(*ec2.RunInstancesInput)
func (m placementMatcher) Matches(input interface{}) bool {
runInstancesInput, ok := input.(*ec2.RunInstancesInput)
if !ok {
return false
}
if input.Placement == m.x {
if runInstancesInput.Placement == m.placement {
return true
}
return false
}

func (m placementMatcher) String() string {
return fmt.Sprintf("is placement: %#v", m.x)
return fmt.Sprintf("is placement: %#v", m.placement)
}

func Placement(x *ec2.Placement) gomock.Matcher { return placementMatcher{x} }
func Placement(placement *ec2.Placement) gomock.Matcher { return placementMatcher{placement} }

0 comments on commit 98b836b

Please sign in to comment.