Go
Updated on October 27, 2026
Go
A go.mod file at the root is enough to trigger automatic compilation of the binary.
net/http
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.Fprint(w, "Hello Webgune")
})
http.ListenAndServe(":"+port, nil)
}
Gin
package main
import (
"os"
"github.com/gin-gonic/gin"
)
func main() {
r := gin.Default()
r.GET("/health", func(c *gin.Context) {
c.JSON(200, gin.H{"ok": true})
})
port := os.Getenv("PORT")
if port == "" {
port = "8080"
}
r.Run("0.0.0.0:" + port)
}
Private modules
If your project depends on a private Go module, configure GOPRIVATE and an access token via the service's environment variables, or switch to a Dockerfile deployment for full control over the build step.