From db49fe85e4213b138e5def3107160ed5420fe8fa Mon Sep 17 00:00:00 2001 From: Jonathan Gold Date: Wed, 8 Nov 2017 16:08:25 -0500 Subject: [PATCH] resources: aws: ec2: Move chanStruct type out of longpollWatch --- resources/aws_ec2.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/resources/aws_ec2.go b/resources/aws_ec2.go index 79f9f1bf..a0423cd1 100644 --- a/resources/aws_ec2.go +++ b/resources/aws_ec2.go @@ -84,6 +84,12 @@ type AwsEc2Res struct { client *ec2.EC2 // client session for AWS API calls } +// chanStruct defines the type for a channel used to pass events and errors to watch. +type chanStruct struct { + str string + err error +} + // Default returns some sensible defaults for this resource. func (obj *AwsEc2Res) Default() Res { return &AwsEc2Res{ @@ -171,10 +177,6 @@ func (obj *AwsEc2Res) longpollWatch() error { if err := obj.Running(); err != nil { return err } - type chanStruct struct { - str string - err error - } awsChan := make(chan *chanStruct) closeChan := make(chan struct{}) ctx, cancel := context.WithCancel(context.TODO())