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"); }