<commit_before>#!/bin/bash

# vim: filetype=sh:tabstop=2:shiftwidth=2:expandtab

# http://www.kfirlavi.com/blog/2012/11/14/defensive-bash-programming/

# Following the following official golang instructions:
# https://golang.org/doc/install

readonly PROGNAME=$(basename $0)
readonly PROGDIR="$( cd "$(dirname "$0")" ; pwd -P )"
readonly ARGS="$@"

# pull in utils
source "${PROGDIR}/utils.sh"


# Make sure we have all the right stuff
prerequisites() {
  # we want to be root to install / uninstall  
  if [ "$EUID" -ne 0 ]; then
    error "Please run as root"
    exit 1
  fi
}


# Uninstall the latest version of Go
uninstall_golang() {
  if [ -f "$DOWNLOADED_FILE" ]; then
    echo ""
    echo "Removing previous download"
    rm -rf "$DOWNLOADED_FILE"
  fi

  if [ -d "$INSTALL_DIR/go" ]; then
    echo ""
    echo "Removing previous installation"
    rm -rf "$INSTALL_DIR/go"
  fi

  if [ -f "$HOME/.golang_profile" ]; then
    echo ""<commit_msg>clean-up<commit_after>#!/bin/bash

# vim: filetype=sh:tabstop=2:shiftwidth=2:expandtab

# http://www.kfirlavi.com/blog/2012/11/14/defensive-bash-programming/

# Following the following official golang instructions:
# https://golang.org/doc/install

readonly PROGNAME=$(basename $0)
readonly PROGDIR="$( cd "$(dirname "$0")" ; pwd -P )"
readonly ARGS="$@"

# pull in utils
source "${PROGDIR}/utils.sh"


# Make sure we have all the right stuff
prerequisites() {
  # we want to be root to install / uninstall
  if [ "$EUID" -ne 0 ]; then
    error "Please run as root"
    exit 1
  fi
}


# Uninstall the latest version of Go
uninstall_golang() {
  if [ -f "$DOWNLOADED_FILE" ]; then
    echo ""
    echo "Removing previous download"
    rm -rf "$DOWNLOADED_FILE"
  fi

  if [ -d "$INSTALL_DIR/go" ]; then
    echo ""
    echo "Removing previous installation"
    rm -rf "$INSTALL_DIR/go"
  fi

  if [ -f "$HOME/.golang_profile" ]; then
    echo ""
{'fraction_non_alphanumeric': 0.14270668773038442, 'fraction_numerical': 0.01474460242232754, 'mean_word_length': 3.3577981651376145, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2806509', 'n_tokens_mistral': 718, 'n_tokens_neox': 653, 'n_words': 192}