I study Golang, I read a book in which the question was asked: "Our program began with package main. How do the files start in the fmt package?"

The book says the following:

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

An explanation is given:

The program that we just wrote can be read as follows: Create a new executable program that uses the fmt library and contains the main function. This function has no arguments, returns nothing and does the following: uses the Println function from the fmt library and calls it, passing one argument - the string Hello World. The Println function performs the main work in this program.

Do I understand correctly that the files in the fmt package start with functions, in this case with "Println"?

    1 answer 1

    import - imports a package by name. A package specifies the name of the package and is written at the top. Therefore, the fmt package must begin with the package fmt or comments, followed by this line.

    • I think, since you mentioned the comments, you can also mention the assembly tags . - Ainar-G