Last active
December 12, 2023 08:32
-
-
Save ezaurum/5b4803114d915f907722c98bf82f4241 to your computer and use it in GitHub Desktop.
go gin / hello world
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | |
} |
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
go.mod file ?