package preprocessor import ( "fmt" cbchelper "git.buran.team/main/cbc/helper" cbcscheme "git.buran.team/main/cbc/scheme" ) type GoModTidyPreprocessor struct { } func NewGoModTidyPreprocessor(preprocessorScheme cbcscheme.TaskPreprocessor) (*GoModTidyPreprocessor, error) { return &GoModTidyPreprocessor{}, nil } func (this *GoModTidyPreprocessor) Process(path string) ([]byte, []byte, error) { stdout, stderr, err := cbchelper.Execute( fmt.Sprintf( "go -C %s mod tidy", path, ), ) if err != nil { return nil, nil, fmt.Errorf("can't go mod tidy over program: %w", err) } return stdout, stderr, nil }