Похоже, GenerateCredentialReportOutput
интерфейс не имеет метода извлечения CSV.Источник тока -
package main
import (
"fmt"
"os"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/iam"
"github.com/aws/aws-sdk-go/service/s3"
)
func main() {
sess, err := session.NewSession(&aws.Config{
Region: aws.String(os.Getenv("AWS_DEFAULT_REGION"))},
)
if err != nil {
fmt.Println("Error", err)
return
}
svciam := iam.New(sess)
getCred, err := svciam.GenerateCredentialReport(&iam.GenerateCredentialReportInput{})
fmt.Println(getCred.State) // gives an encoded output
if err != nil {
fmt.Println("Error", err)
return
}
}