Skip to content

Instantly share code, notes, and snippets.

@cp-sumi-k
Last active October 5, 2022 06:16
Show Gist options
  • Save cp-sumi-k/1d53410f0ee7f75e6341eb6c4f7f02a8 to your computer and use it in GitHub Desktop.
Save cp-sumi-k/1d53410f0ee7f75e6341eb6c4f7f02a8 to your computer and use it in GitHub Desktop.
ctx := context.Background()
/** convert base64 formetted JSON to bytearray */
credBytes, err := b64.StdEncoding.DecodeString(os.Getenv("JSON_BASE64"))
if err != nil {
return false, err
}
/** create reCaptcha client with JSON bytearray */
client, err := recaptcha.NewClient(ctx, option.WithCredentialsJSON(credBytes))
if err != nil {
return false, err
}
/** close client when it's done */
defer client.Close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment