You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: build.go
    path of file: ./repos/grafana/pkg/build/frontend
    
    the code of the file until where you have to start completion: package frontend

import (
	"fmt"
	"log"
	"os"
	"os/exec"
	"path/filepath"

	"github.com/grafana/grafana/pkg/build/config"
	"github.com/grafana/grafana/pkg/build/errutil"
	"github.com/grafana/grafana/pkg/build/lerna"
	"github.com/grafana/grafana/pkg/build/syncutil"
)

func BuildFrontendPackages(version string, edition config.Editi
    
func BuildFrontendPackages(version string, edition config.Edition, grafanaDir string, p syncutil.WorkerPool, g *errutil.Group) error {
	p.Schedule(g.Wrap(func() error {
		if err := lerna.BuildFrontendPackages(version, edition, grafanaDir); err != nil {
			return fmt.Errorf("failed to build %s frontend packages: %v", edition, err)
		}

		log.Printf("Finished building %s frontend packages", string(edition))
		return nil
	}))

	return nil
}