Main package and main function in Golang
www.golearningsource.com › fundamentals › mainMay 10, 2020 · Main function. main package contains a special function called the main function. main function is the entry point to executable programs. main function does not accept any arguments nor does it return any value. Every executable program must contain a single main package and main function. Please refer to other articles to understand how init ...
Learn to create and use Go packages - golangbot.com
golangbot.com › go-packagesFeb 16, 2020 · Let's understand the reason behind this error. go install takes an optional package name as a parameter (in our case the package name is learnpackage) and it tries to compile the main function if the package exists in the current directory from which it is run or in the parent directory or it's parent directory and so on.