You’re taking *string
s when you really only need string
s. It’s a simple change to derefernce the pointers you get back from AWS SDK (it uses pointers for everything for nullability):
var accountList []string
for _, accountId := range result.Accounts {
accountList = append(accountList, *accountId.Id)
}
fmt.Println(accountList)
solved Is it possible to change the output to be an actual string of characters?