Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
November 26, 2022 01:11 pm GMT

Try Hello World of Go in 3min

I wanted to try Hello World in Go, so I will give it a shot.

Install Go

Looking forward to brew.

$ brew install go==> Downloading https://homebrew.bintray.com/bottles/go-1.6.el_capitan.bottle.2.######################################################################## 100.0%==> Pouring go-1.6.el_capitan.bottle.2.tar.gz==> CaveatsAs of go 1.2, a valid GOPATH is required to use the `go get` command:  https://golang.org/doc/code.html#GOPATHYou may wish to add the GOROOT-based install location to your PATH:  export PATH=$PATH:/usr/local/opt/go/libexec/bin==> Summary  /usr/local/Cellar/go/1.6: 5,771 files, 324.9M

Installation complete.
This is really the best level.

Setup Hello World

I'll write hello.go.

package mainimport "fmt"func main() {  fmt.Printf("Hello, world!
")}

Run

I'll run hello.go.

$ go run hello.go

Already done.


Original Link: https://dev.to/yukikmt/try-hello-world-of-go-in-3min-215p

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To