We use packages so we can reuse other peoples code, we don't have to write everything from scratch. Maybe we are wanting a calculator as part of our program, you could probably find an existing Go Package that contains the mathematical functions that you could import into your code saving you a lot of time and effort in the long run.
Go encourages you to organise your code in packages so that it is easy to reuse and maintain source code.
### Hello #90DaysOfDevOps Line by Line
Now let's take a look at our Hello #90DaysOfDevOps main.go file and walk through the lines.
![](Images/Day9_Go2.png)
In the first line, you have `package main` which means that this file belongs to a package called main. All .go files need to belong to a package, they should also have `package something` in the opening line.
A package can be named whatever you wish. We have to call this `main` as this is the starting point of the program that is going to be in this package, this is a rule. (I need to understand more about this rule?)
![](Images/Day9_Go3.png)
Whenever we want to compile and execute our code we have to tell the machine where the execution needs to start. We do this by writing a function called main. The machine will look for a function called main to find the entry point of the program.
A function is a block of code that can do some specific task for and can be used across the program.
You can declare a function with any name using `func` but in this case we need to name it `main` as this is where the code starts.
![](Images/Day9_Go4.png)
Next we are going to look at line 3 of our code, the import, this basically means you want to bring in another package to your main program. fmt is a standard package being used here provided by Go, this package contains the `Println()`function and because we have imported this we can use this in line 6. There are a number of standard packages you can include in your program and leverage or reuse them in your code saving you the hassle of having to write from scratch. [Go Standard Library](https://pkg.go.dev/std)
![](Images/Day9_Go5.png)
the `Println()` that we have here is a way in which to write to a standard output to the terminal where ever the executuable has been executed succesfully. Feel free to change the message in between the ().
![](Images/Day9_Go6.png)
### TLDR
- **Line 1** = This file will be in the package called `main` and this needs to be called `main` because includes the entry point of the program.
- **Line 3** = For us to use the `Println()` we have to import the fmt package to use this on line 6.
- **Line 5** = The actual starting point, its the `main` function.
- **Line 6** = This will let us print "Hello #90DaysOfDevOps" on our system.