Make sure you have Go version 1.17 or newer and the Heroku CLI installed.
$ go build -o bin/server -v .
$ heroku local
Your app should now be running on localhost:4000.
$ heroku create
$ git push heroku main
$ heroku open
or
For more information about using Go on Heroku, see these Dev Center articles: