Learning Go Basics
Concepts
A basic module for understanding functions, error handling, arrays, maps, unit testing, and compiling
-
go mod init download_path/module_name
- greetings package
- hello package
-
cd to hello package
cd hello
-
go run .
greetings package implements Hello and Hellos functions
- this holds various concepts like for loop, array declaration, map, make, error handling, randomFormat function etc.
- this also has a test file to test the implemented method.
hello package
- this holds code to make calls to the Hello/Hellos function in the greetings module.
-
go mod edit
, to edit the mod file generated withgo mod init
*** Gaurav Kaushik ***