August 2019
Beginner to intermediate
798 pages
17h 2m
English
In this section, you will learn how to compile Go code. The good news is that you can compile your Go code from the command line without the need for a graphical application. Furthermore, Go does not care about the name of the source file of an autonomous program as long as the package name is main and there is a single main() function in it. This is because the main() function is where the program execution begins. As a result, you cannot have multiple main() functions in the files of a single project.
We will start our first Go program compilation with a program named aSourceFile.go that contains the following Go code:
package main
import (
"fmt"
)
func main() {
fmt.Println("This is a sample Go program!")
}
Notice that ...
Read now
Unlock full access