<commit_before># Helper functions to build go code in gitlab-shell

require 'fileutils'

# This will set the ROOT_PATH variable
require_relative '../lib/gitlab_init'

module GoBuild
  GO_DIR = 'go'.freeze
  BUILD_DIR = File.join(ROOT_PATH, 'go_build')
  GO_PACKAGE = File.join('gitlab.com/gitlab-org/gitlab-shell', GO_DIR)

  GO_ENV = {
    'GOPATH' => BUILD_DIR,
    'GO15VENDOREXPERIMENT' => '1'
  }.freeze

  def create_fresh_build_dir
    FileUtils.rm_rf(BUILD_DIR)
    build_source_dir = File.join(BUILD_DIR, 'src', GO_PACKAGE)
    FileUtils.mkdir_p(build_source_dir)
    FileUtils.cp_r(File.join(ROOT_PATH, GO_DIR, '.'), build_source_dir)
  end

  def run!(env, cmd, options = {})
    raise "env must be a hash" unless env.is_a?(Hash)
    raise "cmd must be an array" unless cmd.is_a?(Array)

    unless system(env, *cmd, options)
      abort "command failed: #{env.inspect} #{cmd.join(' ')}"
    end
  end
end
<commit_msg>Set Go111MODULE to 'off' during compilation<commit_after># Helper functions to build go code in gitlab-shell

require 'fileutils'

# This will set the ROOT_PATH variable
require_relative '../lib/gitlab_init'

module GoBuild
  GO_DIR = 'go'.freeze
  BUILD_DIR = File.join(ROOT_PATH, 'go_build')
  GO_PACKAGE = File.join('gitlab.com/gitlab-org/gitlab-shell', GO_DIR)

  GO_ENV = {
    'GOPATH' => BUILD_DIR,
    'GO15VENDOREXPERIMENT' => '1',
    'GO111MODULE' => 'off'
  }.freeze

  def create_fresh_build_dir
    FileUtils.rm_rf(BUILD_DIR)
    build_source_dir = File.join(BUILD_DIR, 'src', GO_PACKAGE)
    FileUtils.mkdir_p(build_source_dir)
    FileUtils.cp_r(File.join(ROOT_PATH, GO_DIR, '.'), build_source_dir)
  end

  def run!(env, cmd, options = {})
    raise "env must be a hash" unless env.is_a?(Hash)
    raise "cmd must be an array" unless cmd.is_a?(Array)

    unless system(env, *cmd, options)
      abort "command failed: #{env.inspect} #{cmd.join(' ')}"
    end
  end
end

{'fraction_non_alphanumeric': 0.1278705636743215, 'fraction_numerical': 0.006263048016701462, 'mean_word_length': 3.953488372093023, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, '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': '7206788', 'n_tokens_mistral': 737, 'n_tokens_neox': 720, 'n_words': 165}