Learnerslesson
   JAVA   
  SPRING  
  SPRINGBOOT  
 HIBERNATE 
  HADOOP  
   HIVE   
   ALGORITHMS   
   PYTHON   
   GO   
   KOTLIN   
   C#   
   RUBY   
   C++   




GO - PACKAGE


Ever wondered, what is 'fmt' in the 'Print()' statement?


fmt.Println("Hello World")

Well! If you see the line on the top of every program. We have an 'import' statement.


import "fmt"

Example :



package main
import "fmt"
    
func main() {
    
    fmt.Println("Hello World")
}


Output :



 Hello World

The 'fmt' is actually called a package, where all the functions including 'Println()' is defined.


In other words, if you want to access the 'Println()' function defined in the 'fmt' package.You have to import the 'fmt' Package first.


import "fmt"

Then you can use 'fmt' to access the 'Println()'


fmt.Println("Hello World")