Display useful information about the different commands available. If we need more information about an specific command, type:
# Where [command] can be any of the available commands
go help [command]
If we want to see the whole list of commands available, just type:
go help
This command handle all the differents operations of a module, for example, if we want to initialize a mod inside a current folder, we can run:
go mod init
Check all the differents options with go help mod
command
This command build and run the application and discard the binary file, example:
go run main.go
Note: We have to use this command over a file that use the main
package, If not, we will receive an error: cannot run non-main package
.
This command build and creates a binary or an executable next to the file where we are using this command, if the file is using the main
package, if not it will compile the file but it wont generate anything.