Hello World in Golang Tutorial 1

Hello World in Golang Tutorial 1

Lets start with Module/Package name. First is always main

package main

Lets import fmt package. fmt is used to print the output in console.

import "fmt"

Now Create the first function. Main is always the first function in golang and func keyword is used before the function and var is used before variable.

func main(){}

To print something in console we use print command as follow.

fmt.Print("Hello world");

Complete Source Code

package main
import "fmt"
func main(){
fmt.Print("Hello world");
}
Tony BB
 

TonyBB is a Coach , marketer, hypnotist and a founder of RSKVF Production who specializes in providing simple, affordable, and easy to use solutions for Life.

Click Here to Leave a Comment Below 0 comments

Leave a Reply: