Skip to content

Instantly share code, notes, and snippets.

@ezaurum
Last active December 12, 2023 08:32
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ezaurum/5b4803114d915f907722c98bf82f4241 to your computer and use it in GitHub Desktop.
Save ezaurum/5b4803114d915f907722c98bf82f4241 to your computer and use it in GitHub Desktop.
go gin / hello world
package main
import (
"github.com/gin-gonic/gin"
"net/http"
)
func main() {
r := gin.Default()
r.GET("/", func(c *gin.Context) {
c.String(http.StatusOK, "hello world")
})
r.Run()
}
@abdennour
Copy link

go.mod file ?

@ezaurum
Copy link
Author

ezaurum commented Jul 5, 2021

This code written before go module. You can make your own with go mod init

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment