This package handles reCaptcha (API version 3.0) form submissions in Go.
Install the package in your environment:
go get github.com/hazcod/go-recaptcha
To use it within your own code, import github.com/hazcod/go-recaptcha and call:
recaptcha := Recaptcha{ PrivateKey: "your-recaptcha-private-key" }
Now call recaptcha.Verify(remoteip net.IP, action string, response string, minScore uint)
which will return (success bool, err error)
.
Included with this repo is example.go, a simple HTTP server which creates the reCaptcha form and tests the input.
See the instructions for running the example for more details.