goinstall → go get → tried rust cargo/dep, nope → go module
Old GOPATH way: The Go programming language initially delimited a scope for the location of dependencies and custom projects inside a filesystem. This was defined by the GOPATH environment variable. This means that Go would look for binaries and source code only under the directory pointed to by this variable.
There are three notable directories under GOPATH: src, pkg, and bin. The src directory holds the source code of both your projects and installed dependencies. When you execute a command such as go get github.com/user/repo, the Go tool fetches the module from the specified location and places it into the src directory under the GOPATH, with a path named after the resource's URL.
There are three notable directories under GOPATH: src, pkg, and bin. The src directory holds the source code of both your projects and installed dependencies. When you execute a command such as go get github.com/user/repo, the Go tool fetches the module from the specified location and places it into the src directory under the GOPATH, with a path named after the resource's URL.
In Go, module names are used system-wide and therefore should be as specific as possible
Creating a new module:
create empty directory, and (e.g.) hello.go file as the source file with the package name
The go command resolves imports by using the specific dependency module versions listed in go.mod. When it encounters an import of a package not provided by any module in go.mod, the go command automatically looks up the module containing that package and adds it to go.mod, using the latest version.
"// indirect" comments mean that at the time the require directive was added, the module is not referenced directly in any of the module’s source files.
go.sum file stores checksum. not necessarily a pipfile.lock type file. see more