Govet is a tool that automatically runs and check constructs, helping to find out problems not caught by the compiler.
Code is auto-indented and formatting issues are taken care by Gofmt. Code style is enforced by default in the language which maintains consistency among all developers.
Go will not allow you to import packages that are unused or declared variables which are not used. This emphasizes and forces developers to write clean code.
Lexical scope is within the brackets surrounding it. Function scope lasts for the duration of the function execution.
To import packages, we can use the factored import statement.
Alternatively, we can also use multiple import statements.
We can indicate an alias as well.
We can import a package and ignore it as well:
We can do this to benefit from the
init() function inside the package. The
init() function can help to initialize some drivers etc. which you may require.
Programs start running from the