func Get(bucket *s3.Bucket, key string) ([]byte, error) { attempts := 0 for { attempts++ buff, err := bucket.Get(key) if err == nil { return buff, nil } if attempts >= maxRetries && err != nil { return nil, err } } }