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: pipeline.go
    path of file: ./repos/devspace/pkg/devspace/pipeline
    
    the code of the file until where you have to start completion: package pipeline

import (
	"context"
	"fmt"
	"os"
	"strings"
	"sync"
	"time"

	"github.com/loft-sh/devspace/pkg/devspace/context/values"
	"github.com/loft-sh/devspace/pkg/devspace/kubectl"
	"github.com/loft-sh/devspace/pkg/util/tomb"
	utilerrors "k8s.io/apimachinery/pkg/util/errors"
	"k8s.io/apimachinery/pkg/util/wait"
	"mvdan.cc/sh/v3/expand"

	"github.com/loft-sh/devspace/pkg/devspace/config/versions/latest"
	devspacecontext "github.com/loft-sh/devspace/pkg/devspace/conte
    
func (p *pipeline) StartNewPipelines(ctx devspacecontext.Context, pipelines []*latest.Pipeline, options types.PipelineOptions) error {
	if options.Background {
		for _, configPipeline := range pipelines {
			go func(configPipeline *latest.Pipeline) {
				err := p.startNewPipeline(ctx, configPipeline, randutil.GenerateRandomString(5), options)
				if err != nil {
					ctx.Log().Errorf("starting pipeline %s has failed: %v", configPipeline.Name, err)
				}
			}(configPipeline)
		}
		return nil
	} else if options.Sequential {
		for _, configPipeline := range pipelines {
			err := p.startNewPipeline(ctx, configPipeline, randutil.GenerateRandomString(5), options)
			if err != nil {
				return err
			}
		}

		return nil
	}

	// Start concurrently
	ctx, t := ctx.WithNewTomb()
	t.Go(func() error {
		for _, configPipeline := range pipelines {
			func(configPipeline *latest.Pipeline) {
				t.Go(func() error {
					return p.startNewPipeline(ctx, configPipeline, randutil.GenerateRandomString(5), options)
				})
			}(configPipeline)
		}
		return nil
	})

	return t.Wait()
}