Package in Go.
Go treats files in a single directory as belonging to one package as long as they all have the same name in their package declarations.
Go code is organized into packages (similar to libraries or modules).
Package names are always in lower case.
The first statement in a Go source file must be
package name
Go's convention is that the package name is the last element of the import path. See below.
Executable commands must always use package main.
An import path is a string that uniquely identifies a package.
A package's import path corresponds to its location:
The packages from the standard library are given short import paths such as “fmt” and “net/http”.
import (
"fmt"
"base-path/package-name/go-source-file"
)
The import statement tell the compiler what packages are needed by the source file.
The base path is the root path of (custom|user) package (not standard library or other external libraries)
By convention, each package is described in a comment immediately preceding its package declaration.
go get base_path/package-name
where: