Skip to content

Go

gy detects Go from go.mod, compiles a static binary in a multi-stage build, and ships a minimal container.

Terminal window
cd my-go-app
gy deploy
package main
import (
"fmt"
"net/http"
"os"
)
func main() {
port := os.Getenv("PORT")
if port == "" {
port = "8080"
}
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "Hello from Ghaymah!")
})
http.ListenAndServe(":"+port, nil)
}
Terminal window
gy deploy --port 8080
Terminal window
gy deploy --name my-gin-api
Terminal window
gy deploy --tier t2 --name billing-service
db := os.Getenv("DATABASE_URL")
Terminal window
gy config set env DATABASE_URL=postgres://...
gy config sync