go
01 - Hello World
Hello world in GO!
What have learned?
- Create a module using the
go init
command. - Declare a package.
- Import standard packages.
- Importing external packages.
- Synchronize dependencies using the
go mod tidy
command. - Reference
02 - First module
Creating a module!
What have learned?
- Declaring a function, as well as the type of parameter and return.
- I learned that functions with a capital initial can be called by a function that is not in the same package.
- I learned how to declare a variable and assign the value in one line using
:=
. - Formatting a string using the
Sprintf
function. - Reference
03 - Using module
Import a local module!
What have learned?
- Import a local module.
- Use the
go mod edit -replace module=directory
command to reference a local module. - Reference
04 - Handling errors
Validations and error handling!
What have learned?
- How a function can return multiple values.
- Use the
errors
module to throw exceptions. - Use the
log
module to display errors in the terminal. - Assign value to a variable already declared using
=
. - Reference