<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>get on Golang</title><link>https://golang.k5kc.com/tags/get/</link><description>Recent content in get on Golang</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Sun, 16 Aug 2020 00:12:00 +0530</lastBuildDate><atom:link href="https://golang.k5kc.com/tags/get/index.xml" rel="self" type="application/rss+xml"/><item><title>Understanding the GOPATH environment variable</title><link>https://golang.k5kc.com/2020/08/16/3.understand-gopath/</link><pubDate>Sun, 16 Aug 2020 00:12:00 +0530</pubDate><guid>https://golang.k5kc.com/2020/08/16/3.understand-gopath/</guid><description>The GOPATH environment variable lists places to look for Go code. It defines your workspace. It is likely the only environment variable you&amp;rsquo;ll need to set when developing Go code.
Official documentation:
How to Write Go Code: The GOPATH environment variable Command go: GOPATH environment variable Normally the GOPATH is set in your shell profile (one of ~/.bashrc, ~/.bash_profile, etc).
When you install packages and build binaries, the Go tool will look for source code in $GOPATH/src/ followed by a package import path in order to resolve dependencies.</description></item><item><title>Go Configuration - Environment variables</title><link>https://golang.k5kc.com/2020/08/16/2.go-environment-variables/</link><pubDate>Sun, 16 Aug 2020 00:11:00 +0530</pubDate><guid>https://golang.k5kc.com/2020/08/16/2.go-environment-variables/</guid><description>Open up .profile or .zshrc or .bashrc depending on our OS and add/edit following:
#!/bin/bash # Specifies where the Go destribution is installed on the system. export GOROOT=/usr/local/go # Specifies top-level directory containing source code for all our Go projects. # Inside this directory, we need to create 3 more directories viz. &amp;#34;src&amp;#34;, &amp;#34;pkg&amp;#34; and &amp;#34;bin&amp;#34;. export GOPATH=~/adiwork/go # This directory is also known as Go Workspace. # &amp;#34;src&amp;#34; directory inside Workspace represents where all the Go source code will be stored.</description></item><item><title>"go get" command</title><link>https://golang.k5kc.com/2020/08/16/5.go-get-command/</link><pubDate>Sun, 16 Aug 2020 00:10:00 +0530</pubDate><guid>https://golang.k5kc.com/2020/08/16/5.go-get-command/</guid><description>&amp;ldquo;go get&amp;rdquo; command is the standard way of downloading and installing packages and related dependencies.
The snippet above basically tells the compiler to import the crypto package available at the github.com/mattetti/goRailsYourself/crypto path. It doesn’t mean that the compiler will automatically pull down the repository, so where does it find the code?
You need to pull down the code yourself. The easiest way is to use the go get command provided by Go.</description></item><item><title>Dependency Management - vendoring</title><link>https://golang.k5kc.com/2020/08/16/12.dependency-management-vendoring/</link><pubDate>Sun, 16 Aug 2020 00:10:00 +0530</pubDate><guid>https://golang.k5kc.com/2020/08/16/12.dependency-management-vendoring/</guid><description>Google is well known to have an immense mono repo so go get works well for them. This is not the case with everyone else. By default go get pulls the master branch of the repo you point it at. When you do a go get it pulls in the required dependencies, this means there are issues with reproducibility. As of go 1.5 they looked to address some of the issues by introducing the vendor directory.</description></item></channel></rss>