DEV Community

M Fariz Wisnu prananda
M Fariz Wisnu prananda

Posted on

Hello World with Go!

#go

Alt Text
Hello everyone,

today i will show you, how to print "hello World" with GoLang

before starting this tutorial, make sure you have installed golang.

i'll show you how to install golang firts.

1.Download golang at web Golang
Alt Text
red for Windows, yellow for MacOs, and Green for Linux

i'll show you how to install golang at Windows

2.After you finished download go , setting gopath in your computer like this
Alt Text

3.Now you can start coding!

4.Open Your VS Code , make new folder for code golang

5.Open CMD with ctrl + j , and type like this
go mod init belajar-golang
for make go mod

6.after typing it, there are will be a new file called name go.mod
Alt Text

7.then create new file named main.go
8.then type code like this

package main

import "fmt"

func main(){
    fmt.Println("Hello World!")
}
Enter fullscreen mode Exit fullscreen mode

9.and after type code , run the file main.go with command like this
go run main.go

10.The result will be like this
Alt Text

And that the way to print "Hello World" with Golang

Top comments (0)