<commit_before>// Copyright 2012 the u-root Authors. All rights reserved
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Script takes the arg list, does minimal rewriting, builds it and runs it
package main

import (
       "flag"
	"log"
	"os"
	"os/exec"

	"golang.org/x/tools/imports"
)

func main() {
     opts := imports.Options{
     Fragment: true,
     AllErrors: true,
     Comments: true,
     TabIndent: true,
     TabWidth: 8,
     }
	flag.Parse()
	a := ""
	for _, v := range flag.Args() {
	    a = a + v
	    }
	   log.Printf("'%v'", a)
	goCode, err := imports.Process("commandline", []byte(a), &opts)
	if err != nil {
	   log.Fatalf("bad parse: '%v': %v", a, err)
	   }
	   log.Printf("%v", a)

	f, err := TempFile("", "script%s.go")
	if err != nil {
		log.Fatalf("Script: opening TempFile: %v", err)
	}

	if _, err := f.Write([]byte(goCode)); err != nil {
		log.Fatalf("Script: Writing %v: %v", f, err)
	}
	if err := f.Close(); err != nil {
		log.Fatalf("Script: Closing %v: %v", f, err)
	}

	os.Setenv("GOBIN", "/tmp")<commit_msg>A reasonable compromise for now<commit_after>// Copyright 2012 the u-root Authors. All rights reserved
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Script takes the arg list, does minimal rewriting, builds it and runs it
package main

import (
       "flag"
	"log"
	"os"
	"os/exec"

	"golang.org/x/tools/imports"
)

func main() {
     opts := imports.Options{
     Fragment: true,
     AllErrors: true,
     Comments: true,
     TabIndent: true,
     TabWidth: 8,
     }
	flag.Parse()
	a := "func main()"
	for _, v := range flag.Args() {
	    a = a + v
	    }
	   log.Printf("'%v'", a)
	goCode, err := imports.Process("commandline", []byte(a), &opts)
	if err != nil {
	   log.Fatalf("bad parse: '%v': %v", a, err)
	   }
	   log.Printf("%v", a)

	f, err := TempFile("", "script%s.go")
	if err != nil {
		log.Fatalf("Script: opening TempFile: %v", err)
	}

	if _, err := f.Write([]byte(goCode)); err != nil {
		log.Fatalf("Script: Writing %v: %v", f, err)
	}
	if err := f.Close(); err != nil {
		log.Fatalf("Script: Closing %v: %v", f, err)
	}

	os.Setenv("GOBIN", "/tmp")
{'fraction_non_alphanumeric': 0.1779168529280286, 'fraction_numerical': 0.004470272686633884, 'mean_word_length': 2.845360824742268, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3594624', 'n_tokens_mistral': 855, 'n_tokens_neox': 825, 'n_words': 257}