I'm trying to create a func that accepts and returns any number of arguments. I came across anoymous functions:
func AWSApiRetry(awsFunc func()) {
return awsFunc()
}
This allows me to call a func:
AWSApiRetry(func() {
GetEnvState(sess, ApplicationName, EnvName)
})
but when I try to retrieve the return values from GetEnvState which are (string, err):
ElbReady, err := AWSApiRetry(func() {
GetEnvState(sess, ApplicationName, EnvName)
})
I'm getting the error: AWSApiRetry(func literal) used as value
How can I use my AwsApiretry func to return those types anonymously. It can be any number and type of return values, so it just sort of 'pass-through' and returns whatever the func being called returns.