Setup Go with ansible for Golang programming

Intro

Are you struggling how to install Go ? Setting $GOPATH , $GOTROOT, … ?

Bias for action

  1. Install the role :
ansible-galaxy install abdennour.golang
- hosts: localhost # if you want to target another host, change it
tasks:
- import_role:
name: abdennour.golang
become: yes
vars:
golang_version: "1.14"
golang_packages:
- github.com/gorilla/mux
- go.mongodb.org/mongo-driver/mongo
golang_users:
- "YOUR_USERNAME" # "{{ ansible_ssh_user}}" might be suitable
ansible-playbook ./yourfile_above.yaml
go version

Reliability

We are happy to release this role with a full end-to-end tests using molecule:

Software engineer, Cloud Architect, 5/5 AWS|GCP|PSM Certified, Owner of kubernetes.tn