<commit_before># download golang 1.5.1 binaries
remote_file '/home/vagrant/go1.5.1.linux-amd64.tar.gz' do
  source 'https://storage.googleapis.com/golang/go1.5.1.linux-amd64.tar.gz'
  mode '0655'
  action :create
end

# unpack golang binaries to /usr/local
bash 'install-golang' do
  cwd "/home/vagrant"
  code "sudo tar -C /usr/local -xzf go1.5.1.linux-amd64.tar.gz"
end

# add Go env vars to bash profile
ruby_block "insert_line" do
  block do
    file = Chef::Util::FileEdit.new("/home/vagrant/.bashrc")
    file.insert_line_if_no_match("^export GOPATH\=.vagrant", "export GOPATH=/vagrant")
    file.insert_line_if_no_match("^export GOROOT\=\/usr\/local\/go", "export GOROOT=/usr/local/go")
    file.insert_line_if_no_match("^export PATH\=.PATH..GOROOT\/bin", "export PATH=$PATH:$GOROOT/bin")
    file.insert_line_if_no_match("^alias projectdir.+", "alias projectdir='cd $GOPATH/src/eps-conduit'")
    file.write_file
  end
end

# add Go env vars to bash profile
ruby_block "insert_line" do
  block do
    file = Chef::Util::FileEdit.new("/etc/profile")
    file.insert_line_if_no_match("^export GOPATH\=.vagrant", "export GOPATH=/vagrant")
    file.insert_line_if_no_match("^export GOROOT\=\/usr\/local\/go", "export GOROOT=/usr/local/go")
    file.insert_line_if_no_match("^export PATH\=.PATH..GOROOT\/bin", "export PATH=$PATH:$GOROOT/bin")
    file.write_file
  end
end

# Create paths for go files
gopath = '/vagrant'<commit_msg>added go bin to PATH<commit_after># download golang 1.5.1 binaries
remote_file '/home/vagrant/go1.5.1.linux-amd64.tar.gz' do
  source 'https://storage.googleapis.com/golang/go1.5.1.linux-amd64.tar.gz'
  mode '0655'
  action :create
end

# unpack golang binaries to /usr/local
bash 'install-golang' do
  cwd "/home/vagrant"
  code "sudo tar -C /usr/local -xzf go1.5.1.linux-amd64.tar.gz"
end

# add Go env vars to bash profile
ruby_block "insert_line" do
  block do
    file = Chef::Util::FileEdit.new("/home/vagrant/.bashrc")
    file.insert_line_if_no_match("^export GOPATH\=.vagrant", "export GOPATH=/vagrant")
    file.insert_line_if_no_match("^export GOROOT\=\/usr\/local\/go", "export GOROOT=/usr/local/go")
    file.insert_line_if_no_match("^export PATH\=.PATH..GOROOT\/bin", "export PATH=$PATH:$GOROOT/bin")
    file.insert_line_if_no_match("^export PATH\=.PATH..vagrant\/bin", "export PATH=$PATH:/vagrant/bin")
    file.insert_line_if_no_match("^alias projectdir.+", "alias projectdir='cd $GOPATH/src/eps-conduit'")
    file.write_file
  end
end

# add Go env vars to bash profile
ruby_block "insert_line" do
  block do
    file = Chef::Util::FileEdit.new("/etc/profile")
    file.insert_line_if_no_match("^export GOPATH\=.vagrant", "export GOPATH=/vagrant")
    file.insert_line_if_no_match("^export GOROOT\=\/usr\/local\/go", "export GOROOT=/usr/local/go")
    file.insert_line_if_no_match("^export PATH\=.PATH..GOROOT\/bin", "export PATH=$PATH:$GOROOT/bin")
    file.write_file
  end
end

# Create paths for go files
gopath = '/vagrant'
{'fraction_non_alphanumeric': 0.1585652028159571, 'fraction_numerical': 0.014750251424740195, 'mean_word_length': 4.216783216783217, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, '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': '2996905', 'n_tokens_mistral': 1243, 'n_tokens_neox': 1151, 'n_words': 213}