Cognito DeleteUser (cognitoidentityprovider) for Go/Golang #1860
-
Hello, I am looking for some help on how to implement/use the DeleteUser function in the cognitoidentityoprovider module.
I am going to attach some screenshots of my code in a word doc. Hopefully someone will be able to make sense of what I've attempted to do and redirect me where I've gone off course. I'm new, so it's likely that I'm making this way more complicate than it needs to be. So far, I have not able to follow the documentation in an intuitive manner. Thanks! Document of code screenshots: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I'm not sure how your project is structured, but you should not make any changes to the source files just to use the SDK. Here is a code example: func main() {
cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithRegion("us-east-1"))
if err != nil {
log.Fatalf("unable to load SDK config, %v", err)
}
client := cognito.NewFromConfig(cfg)
deleteUserInput := &cognito.DeleteUserInput{
AccessToken: aws.String("AccessTokenGoesHere"),
}
_, err = client.DeleteUser(context.Background(), deleteUserInput)
if err != nil {
fmt.Errorf("could not create cognito user: %v", err.Error())
}
} If you want me to take a look at your code please paste it here in the thread add three backticks (```) before AND after your code block for github to format the code. |
Beta Was this translation helpful? Give feedback.
I'm not sure how your project is structured, but you should not make any changes to the source files just to use the SDK.
Here is a code example:
If you want me to take a look at your code please paste it here in the thread
add three…