go mod command.
Don’t worry about what a module is right now! We will discuss that soon. For now, assume that the module is basically a collection of Go packages.
main.go file and write a program that simply prints hello world.
If you’re wondering,
fmt is part of the Go standard library which is a set of core packages provided by the language.Structure of a Go Program
Now, let’s quickly break down what we did here, or rather the structure of a Go program.Remember, the goal here is to keep a mental note, and later in the course, we’ll learn about
functions, imports, and other things in detail!Running Go Code
Finally, to run our code, we can simply usego run command.