22
loading...
This website collects cookies to deliver better user experience
main.go
package main
import "fmt"
func main() {
fmt.Println("First Go program !!")
}
main
package at the start of the file to let Go know that all the methods in this file belongs to main
packagePackage is a way to group functions, and it's made up of all the files in the same directory
fmt
package which contains function to print to the consolemain
which contains the logic to print to console. main
function inside Go package is called by default when you run the packagego run main.go
Output: First Go program !!
go build main.go
main
./main
Output: First Go program !!