Skip to content

heroku/go-getting-started

Folders and files

NameName
Last commit message
Last commit date

Latest commit

98ac31f · Apr 3, 2025

History

92 Commits
Apr 3, 2025
Mar 7, 2023
Dec 10, 2024
Mar 7, 2025
Jan 8, 2025
Dec 12, 2017
Mar 21, 2019
Oct 14, 2021
Dec 7, 2016
Dec 6, 2022
Dec 10, 2024
Nov 21, 2024
Mar 7, 2025
Mar 7, 2025
Nov 29, 2017
Oct 24, 2017

Repository files navigation

Go Getting Started

A barebones Go app, which can easily be deployed to Heroku.

This application supports the tutorials for both the Cedar and Fir generations of the Heroku platform. You can check them out here:

Running Locally

Make sure you have Go version 1.17 or newer and the Heroku CLI installed.

$ git clone https://github.com/heroku/go-getting-started.git
$ cd go-getting-started
$ go build -o bin/go-getting-started -v . # or `go build -o bin/go-getting-started.exe -v .` in git bash
github.com/mattn/go-colorable
gopkg.in/bluesuncorp/validator.v5
golang.org/x/net/context
github.com/heroku/x/hmetrics
github.com/gin-gonic/gin/render
github.com/manucorporat/sse
github.com/heroku/x/hmetrics/onload
github.com/gin-gonic/gin/binding
github.com/gin-gonic/gin
github.com/heroku/go-getting-started
$ heroku local

Your app should now be running on localhost:5006.

Deploying to Heroku

Using resources for this example app counts towards your usage. Delete your app and database as soon as you are done experimenting to control costs.

Deploy on Heroku Cedar

By default, apps use Eco dynos if you are subscribed to Eco. Otherwise, it defaults to Basic dynos. The Eco dynos plan is shared across all Eco dynos in your account and is recommended if you plan on deploying many small apps to Heroku. Learn more about our low-cost plans here.

Eligible students can apply for platform credits through our new Heroku for GitHub Students program.

$ heroku create
$ git push heroku main
$ heroku open

Deploy on Heroku Fir

By default, apps on Fir use 1X-Classic dynos. To create an app on Fir you'll need to create a private space first.

$ heroku create --space <space-name>
$ git push heroku main
$ heroku ps:wait
$ heroku open

Documentation

For more information about using Go on Heroku, see these Dev Center articles: