#!/usr/bin/env bash
#
# This sets up Go based on the project's Go version. It will configure
# GOROOT and add GOROOT/bin to PATH before executing the given command.
#
# Example usage: ./run_with_go_ver go version
#
set -e

# Script directory:
SDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

source "${SDIR}/common.bash"

get_go_version
setup_go_root ${GO_VERSION}
bash -c "$*"
