Lädt...

🔧 How to install and configure Golang


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

In this article, you will see how to install Golang and configure it to use the private GitHub repositories of your company.

Right to the point

BE SURE TO REPLACE {VERSION} WITH THE DESIRED VERSION THAT YOU WANT!!!

Download Go

curl -OL https://golang.org/dl/go{VERSION}.linux-amd64.tar.gz

Install Go

sudo tar -C /usr/local -xvf go{VERSION}.linux-amd64.tar.gz

Configure Go

sudo nano ~/.profile
# Or with zsh:
sudo nano ~/.zprofile

Paste this at the end of the file, replacing {YOUR COMPANY ALIAS} with your company alias:

# Golang
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
export GOPRIVATE=github.com/{YOUR COMPANY ALIAS}/*
export PATH=$PATH:$GOROOT:$GOPATH:$GOBIN
export PATH="$PATH:$(go env GOPATH)/bin"

Run this to update your terminal and apply the changes:

source ~/.profile
# Or with zsh:
source ~/.zprofile

Configure SSH key on GitHub

Run this, and remember to replace {YOUR EMAIL}\ with your email:

  • Run this and only press enter until the command stop

  • The ssh key MUST NOT have a password

ssh-keygen -t ed25519 -C "{YOUR EMAIL}"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
cat ~/.ssh/id_ed25519.pub

Copy the content displayed on your terminal, including your email. COPY EVERYTHING that the previous command returned.

Go to GitHub and follow this tutorial to add the SSH key.

Configure Git

sudo nano ~/.gitconfig

Paste this at the end of the file:

[url "ssh://[email protected]/"]
    insteadOf = https://github.com/

Done!

Now you can work with Golang and private repositories on GitHub with no problems!

...

🔧 How to install and configure Golang


📈 31.28 Punkte
🔧 Programmierung

🔧 Exploring Golang: Insights from the Latest Golang Nugget


📈 22.58 Punkte
🔧 Programmierung

🔧 Golang: Practical Cases to Use the Golang Sleep Method


📈 22.58 Punkte
🔧 Programmierung

🔧 GoLang JWT Authentication Using Golang Gin Framework with MongoDB


📈 22.58 Punkte
🔧 Programmierung

🔧 How to use GoLang in Flutter Application - Golang FFI


📈 22.58 Punkte
🔧 Programmierung

🕵️ GitHub Security Lab: Golang : Improvements to Golang SSRF query


📈 22.58 Punkte
🕵️ Sicherheitslücken

🔧 How to install and configure Fail2ban for protecting SSH and Nginx


📈 21.35 Punkte
🔧 Programmierung

📰 How to Install and Configure TFTP Server on Ubuntu and Debian


📈 21.35 Punkte
🐧 Unix Server

🔧 Django AllAuth Chapter 2 - How to install and configure Django AllAuth


📈 19.99 Punkte
🔧 Programmierung

📰 How to Install and Configure Caching-Only DNS Server with Bind in Rhel/Centos


📈 19.99 Punkte
📰 Alle Kategorien

🔧 How to Install and Configure DNS Server on Windows Server 2016/2019/2022?


📈 19.99 Punkte
🔧 Programmierung

🐧 How to Install and Configure Git on Debian 11


📈 19.99 Punkte
🐧 Linux Tipps

📰 How to Install and Configure a VPN on LibreELEC


📈 19.99 Punkte
🖥️ Betriebssysteme

🔧 How to Install and Configure ownCloud on CentOS 9 Stream


📈 19.99 Punkte
🔧 Programmierung

📰 How to install and configure WireGuard VPN on Linux


📈 19.99 Punkte
📰 IT Security Nachrichten

🔧 How to Install and Configure DNS Server on Windows Server 2016/2019/2022?


📈 19.99 Punkte
🔧 Programmierung

🔧 How to Install and Configure the Console ninja Vscode Extension


📈 19.99 Punkte
🔧 Programmierung

🎥 How To Install and Configure Veil Framework on Kali Linux 2.x (Kali Sana)


📈 19.99 Punkte
🎥 IT Security Video

📰 Step by Step Install and Configure Exchange Server 2016 on Windows Server 2016


📈 19.99 Punkte
📰 Alle Kategorien

📰 How to Install and Configure OpenVPN Server in RHEL 9


📈 19.99 Punkte
🐧 Unix Server

📰 How to install and configure Easy Digital Downloads on WordPress


📈 19.99 Punkte
📰 IT Nachrichten

🎥 Android - Install and configure ngrok in Termux


📈 19.99 Punkte
🎥 IT Security Video

🔧 How to Install and Configure Cloudflared on Linux


📈 19.99 Punkte
🔧 Programmierung

🎥 How To Install And Configure Arch Linux For Penetration Testing


📈 19.99 Punkte
🎥 IT Security Video

🔧 How to Install and Configure a Private BIND DNS Server on Ubuntu 22.04


📈 19.99 Punkte
🔧 Programmierung

🔧 How to install and Configure NVM on Mac OS


📈 19.99 Punkte
🔧 Programmierung

🪟 How to install and configure MultiPoint Service on Windows Server


📈 19.99 Punkte
🪟 Windows Tipps

🐧 How to install and configure git on Fedora


📈 19.99 Punkte
🐧 Linux Tipps

📰 How to install and configure fail2ban for even more SSH security


📈 19.99 Punkte
📰 IT Nachrichten

📰 Step by Step Install and Configure Exchange Server 2016 on Windows Server 2016


📈 19.99 Punkte
📰 Alle Kategorien