<commit_before>GOGO_HOME=~/.gogo
mkdir -p $GOGO_HOME
GOOGLE_GO_REPO=https://go.googlesource.com/go

gogo() {
  if [ -z "$1" ]; then
    echo "TODO usage message"
    return 0
  fi

  subcommand=$1
  shift

  case $subcommand in
    list)
      gogo_list "$1"
      ;;

    install)
      gogo_install "$1"
      ;;

    use)
      ;;

    *)
      echo "invalid subcommand $subcommand" >&2
      return 1
  esac
}

gogo_list() {
  if [ -n "$1" ]; then
    if [ "$1" != "--all" ]; then
      echo "usage: gogo list [--all]" >&2
      return 1
    fi

    git ls-remote -t $GOOGLE_GO_REPO | grep refs/tags/go | awk -F/ '{ print $NF }'
    return 0
  fi

  ls $GOGO_HOME
}

gogo_install() {
  if [ -z "$1" ]; then
    echo "usage: gogo install go1.4.3" >&2
    return 1
  fi

  local version="$1"
  shift

  pushd $GOGO_HOME
  git clone $GOOGLE_GO_REPO $version
  pushd $GOGO_HOME/$version
  git checkout $version
  pushd src
  ./make.bash
  popd
  popd
  popd
}<commit_msg>use changes go version<commit_after>GOGO_HOME=~/.gogo
mkdir -p $GOGO_HOME
GOOGLE_GO_REPO=https://go.googlesource.com/go

gogo() {
  if [ -z "$1" ]; then
    echo "TODO usage message"
    return 0
  fi

  subcommand=$1
  shift

  case $subcommand in
    list)
      gogo_list "$1"
      ;;

    install)
      gogo_install "$1"
      ;;

    use)
      gogo_use "$1"
      ;;

    *)
      echo "invalid subcommand $subcommand" >&2
      return 1
  esac
}

gogo_list() {
  if [ -n "$1" ]; then
    if [ "$1" != "--all" ]; then
      echo "usage: gogo list [--all]" >&2
      return 1
    fi

    git ls-remote -t $GOOGLE_GO_REPO | grep refs/tags/go | awk -F/ '{ print $NF }'
    return 0
  fi

  ls $GOGO_HOME
}

gogo_install() {
  if [ -z "$1" ]; then
    echo "usage: gogo install go1.4.3" >&2
    return 1
  fi

  local version="$1"
  shift

  pushd $GOGO_HOME
  git clone $GOOGLE_GO_REPO $version
  pushd $GOGO_HOME/$version
  git checkout $version
  pushd src
  ./make.bash
  popd
  popd
  popd
}

gogo_use() {
  if [ -z "$1" ]; then
    echo "usage: gogo use go1.4.3" >&2
    return 1
  fi

  local version="$1"
  shift

  export GOROOT=$GOGO_HOME/$version
  export PATH=$GOROOT/bin:$(echo $PATH | tr ':' '\n' | grep -v $GOGO_HOME | tr '\n' ':' | sed 's/:*$//')
}
{'fraction_non_alphanumeric': 0.14694059848146493, 'fraction_numerical': 0.02054488610987048, 'mean_word_length': 2.159379407616361, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1471683', 'n_tokens_mistral': 969, 'n_tokens_neox': 906, 'n_words': 244}