<commit_before>package work

import (
	"fmt"
	"go/parser"
	"go/token"
	"log"
	"os"
	"os/exec"
	"path/filepath"
	"strings"
)

// NewBuild creates a Build struct which can build from goc temporary directory,
// and generate binary in current working directory
func NewBuild(buildflags string, args []string, workingDir string, outputDir string) (*Build, error) {
	b := &Build{
		BuildFlags: buildflags,
		WorkingDir: workingDir,
	}
	if err := b.CreateTmpWorkingDir(); err != nil {
		return nil, err
	}
	b.OriGOPATH = os.Getenv("GOPATH")
	if b.OriGOPATH == "" {
		b.NewGOPATH = b.TmpDir
	} else {
		b.NewGOPATH = fmt.Sprintf("%v:%v", b.TmpDir, b.OriGOPATH)
	}
	var packages []string
	for _, arg := range args {
		dir, _ := filepath.Split(arg)
		fset := token.NewFileSet()
		pkgs, _ := parser.ParseDir(fset, dir, nil, 0)
		if _, ok := pkgs["main"]; ok {<commit_msg>fixed comment<commit_after>package work

import (
	"fmt"
	"go/parser"
	"go/token"
	"log"
	"os"
	"os/exec"
	"path/filepath"
	"strings"
)

// NewBuild creates a Build struct which can build from gop temporary directory,
// and generate binary in current working directory
func NewBuild(buildflags string, args []string, workingDir string, outputDir string) (*Build, error) {
	b := &Build{
		BuildFlags: buildflags,
		WorkingDir: workingDir,
	}
	if err := b.CreateTmpWorkingDir(); err != nil {
		return nil, err
	}
	b.OriGOPATH = os.Getenv("GOPATH")
	if b.OriGOPATH == "" {
		b.NewGOPATH = b.TmpDir
	} else {
		b.NewGOPATH = fmt.Sprintf("%v:%v", b.TmpDir, b.OriGOPATH)
	}
	var packages []string
	for _, arg := range args {
		dir, _ := filepath.Split(arg)
		fset := token.NewFileSet()
		pkgs, _ := parser.ParseDir(fset, dir, nil, 0)
		if _, ok := pkgs["main"]; ok {
{'fraction_non_alphanumeric': 0.15098722415795587, 'fraction_numerical': 0.0011614401858304297, 'mean_word_length': 3.8948863636363638, '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': '3189305', 'n_tokens_mistral': 686, 'n_tokens_neox': 659, 'n_words': 173}