From 7afdacb5a3bf43a0c5288a99074204e953036775 Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Wed, 18 May 2022 15:46:00 +0300 Subject: [PATCH] bash/usr-local-bin/go: add a quick go snap wrapper mainly for Debian/Ubuntu LTS --- bash/usr-local-bin/go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 bash/usr-local-bin/go diff --git a/bash/usr-local-bin/go b/bash/usr-local-bin/go new file mode 100755 index 0000000..6261935 --- /dev/null +++ b/bash/usr-local-bin/go @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# Using the snap version of go if available + +set -x + +# Check if go is installed through snap +if [ -f /snap/bin/go ] +then + snap run go $@ + +# Fallback to system installation +else + /usr/bin/go $@ +fi + +set +x