An Interest In:
Web News this Week
- April 2, 2024
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
November 26, 2022 01:11 pm GMT
Original Link: https://dev.to/yukikmt/try-hello-world-of-go-in-3min-215p
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:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To