Check out example codes for "main function golang". It will help you in understanding the concepts better.

Code Example 1

// Go program to illustrate the 
// concept of main() function 
  
// Declaration of the main package 
package main 
  
// Importing packages 
import ( 
    "fmt"
    "sort"
    "strings"
    "time"
) 
  
// Main function 
func main() { 
  
    // Sorting the given slice 
    s := []int{345, 78, 123, 10, 76, 2, 567, 5} 
    sort.Ints(s) 
    fmt.Println("Sorted slice: ", s) 
  
    // Finding the index 
    fmt.Println("Index value: ", strings.Index("GeeksforGeeks", "ks")) 
  
    // Finding the time 
    fmt.Println("Time: ", time.Now().Unix()) 
  
}

Learn ReactJs, React Native from akashmittal.com