13Languages
Go
00 Basic
bash45 lines
## ------------------| Install### Download and install from https://go.dev/dl/go version
## ------------------| Create projectmkdir hello-world && hello-worldgo mod init hello-worldtouch main.go
## ------------------| main.gopackage main
import "fmt"
func main() { fmt.Println("Hello, World!") //This is a single-line comment}
## ------------------| Add Dependency### Method Igo get github.com/gin-gonic/gingo get -u github.com/gin-gonic/gin # update to the latest versiongo get -u ./... # update all dependencies### Method IIpackage main
import ( "fmt" "github.com/gin-gonic/gin" // Add Dependency here!)
func main() { fmt.Println("Using Gin Web Framework") r := gin.Default() r.GET("/", func(c *gin.Context) { c.JSON(200, gin.H{"message": "Hello, World!"}) }) r.Run()}
## ------------------| Run the programgo run main.go
## ------------------| Build the programgo build